Add reblog and unreblog endpoints

This commit is contained in:
Jesse Wierzbinski 2023-11-11 22:28:06 -10:00
parent 5bba96435c
commit ca94c35bc4
No known key found for this signature in database
GPG key ID: F9A1E418934E40B0
9 changed files with 368 additions and 7 deletions

View file

@ -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;