refactor: enhance type safety by replacing any types with stricter types across the codebase, improving error handling and reducing potential bugs

This commit is contained in:
Usman Baig
2026-02-22 20:29:16 +01:00
parent 1947c6a886
commit 06f54176f1
15 changed files with 94 additions and 65 deletions

View File

@@ -24,9 +24,9 @@ export function getSignupUrl(redirectPath = '/auth/callback') {
export class ApiError extends Error {
status: number
data?: any
data?: Record<string, unknown>
constructor(message: string, status: number, data?: any) {
constructor(message: string, status: number, data?: Record<string, unknown>) {
super(message)
this.status = status
this.data = data

View File

@@ -86,10 +86,7 @@ export async function sendInvitation(
role: string = 'member',
captcha?: { captcha_id?: string, captcha_solution?: string, captcha_token?: string }
): Promise<OrganizationInvitation> {
const body: any = {
email,
role
}
const body: Record<string, string> = { email, role }
if (captcha?.captcha_id) body.captcha_id = captcha.captcha_id
if (captcha?.captcha_solution) body.captcha_solution = captcha.captcha_solution