website refactor
This commit is contained in:
@@ -42,8 +42,8 @@ export class SponsorService implements Service {
|
||||
return Result.err({ type: 'notFound', message: 'Sponsor not found' });
|
||||
}
|
||||
return Result.ok(result);
|
||||
} catch (error) {
|
||||
return Result.err({ type: 'unknown', message: 'Failed to get sponsor' });
|
||||
} catch (error: unknown) {
|
||||
return Result.err({ type: 'unknown', message: (error as Error).message || 'Failed to get sponsor' });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,8 +54,8 @@ export class SponsorService implements Service {
|
||||
return Result.err({ type: 'notFound', message: 'Dashboard not found' });
|
||||
}
|
||||
return Result.ok(result);
|
||||
} catch (error) {
|
||||
return Result.err({ type: 'notImplemented', message: 'getSponsorDashboard' });
|
||||
} catch (error: unknown) {
|
||||
return Result.err({ type: 'notImplemented', message: (error as Error).message || 'getSponsorDashboard' });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,12 +66,12 @@ export class SponsorService implements Service {
|
||||
return Result.err({ type: 'notFound', message: 'Sponsorships not found' });
|
||||
}
|
||||
return Result.ok(result);
|
||||
} catch (error) {
|
||||
return Result.err({ type: 'notImplemented', message: 'getSponsorSponsorships' });
|
||||
} catch (error: unknown) {
|
||||
return Result.err({ type: 'notImplemented', message: (error as Error).message || 'getSponsorSponsorships' });
|
||||
}
|
||||
}
|
||||
|
||||
async getBilling(): Promise<Result<SponsorBillingDTO, DomainError>> {
|
||||
async getBilling(_: string): Promise<Result<SponsorBillingDTO, DomainError>> {
|
||||
return Result.err({ type: 'notImplemented', message: 'getBilling' });
|
||||
}
|
||||
|
||||
@@ -95,8 +95,8 @@ export class SponsorService implements Service {
|
||||
try {
|
||||
await this.apiClient.acceptSponsorshipRequest(requestId, { respondedBy: sponsorId });
|
||||
return Result.ok(undefined);
|
||||
} catch (error) {
|
||||
return Result.err({ type: 'unknown', message: 'Failed to accept sponsorship request' });
|
||||
} catch (error: unknown) {
|
||||
return Result.err({ type: 'unknown', message: (error as Error).message || 'Failed to accept sponsorship request' });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,8 +104,8 @@ export class SponsorService implements Service {
|
||||
try {
|
||||
await this.apiClient.rejectSponsorshipRequest(requestId, { respondedBy: sponsorId, reason });
|
||||
return Result.ok(undefined);
|
||||
} catch (error) {
|
||||
return Result.err({ type: 'unknown', message: 'Failed to reject sponsorship request' });
|
||||
} catch (error: unknown) {
|
||||
return Result.err({ type: 'unknown', message: (error as Error).message || 'Failed to reject sponsorship request' });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,8 +113,8 @@ export class SponsorService implements Service {
|
||||
try {
|
||||
const result = await this.apiClient.getPendingSponsorshipRequests(input);
|
||||
return Result.ok(result);
|
||||
} catch (error) {
|
||||
return Result.err({ type: 'notImplemented', message: 'getPendingSponsorshipRequests' });
|
||||
} catch (error: unknown) {
|
||||
return Result.err({ type: 'notImplemented', message: (error as Error).message || 'getPendingSponsorshipRequests' });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user