mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor: ♻️ Always use explicit types in every function
This commit is contained in:
parent
54cea29ce9
commit
c1dcdc78ae
62 changed files with 359 additions and 226 deletions
|
|
@ -219,14 +219,18 @@ export class InboxProcessor {
|
|||
|
||||
try {
|
||||
return await handler.parseBody<Response>({
|
||||
note: () => this.processNote(),
|
||||
follow: () => this.processFollowRequest(),
|
||||
followAccept: () => this.processFollowAccept(),
|
||||
followReject: () => this.processFollowReject(),
|
||||
"pub.versia:likes/Like": () => this.processLikeRequest(),
|
||||
delete: () => this.processDelete(),
|
||||
user: () => this.processUserRequest(),
|
||||
unknown: () =>
|
||||
note: (): Promise<Response> => this.processNote(),
|
||||
follow: (): Promise<Response> => this.processFollowRequest(),
|
||||
followAccept: (): Promise<Response> =>
|
||||
this.processFollowAccept(),
|
||||
followReject: (): Promise<Response> =>
|
||||
this.processFollowReject(),
|
||||
"pub.versia:likes/Like": (): Promise<Response> =>
|
||||
this.processLikeRequest(),
|
||||
delete: (): Promise<Response> => this.processDelete(),
|
||||
user: (): Promise<Response> => this.processUserRequest(),
|
||||
unknown: (): Response &
|
||||
TypedResponse<{ error: string }, 400, "json"> =>
|
||||
this.context.json({ error: "Unknown entity type" }, 400),
|
||||
});
|
||||
} catch (e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue