mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
Add reblog and unreblog endpoints
This commit is contained in:
parent
5bba96435c
commit
ca94c35bc4
9 changed files with 368 additions and 7 deletions
|
|
@ -17,6 +17,11 @@ export async function parseRequest<T>(request: Request): Promise<Partial<T>> {
|
|||
query.append(key, JSON.stringify(value));
|
||||
}
|
||||
|
||||
// If body is empty
|
||||
if (request.body === null) {
|
||||
return {};
|
||||
}
|
||||
|
||||
// if request contains a JSON body
|
||||
if (request.headers.get("Content-Type")?.includes("application/json")) {
|
||||
return (await request.json()) as T;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue