add report admin panel
All checks were successful
delpoy / build-and-deploy (push) Successful in 53s

This commit is contained in:
2023-09-29 02:08:34 +02:00
parent 37c230575d
commit 722026c938
19 changed files with 423 additions and 26 deletions

View File

@ -17,14 +17,15 @@ export const POST = (async ({ request, url }) => {
subject: data.reason,
body: null,
draft: true,
url_id: crypto.randomBytes(18).toString('hex'),
status: 'none',
url_hash: crypto.randomBytes(18).toString('hex'),
completed: false,
reporter_user_id: reporter.id,
reported_user_id: reported.id
reporter_id: reporter.id,
reported_id: reported.id
});
return new Response(
JSON.stringify({ url: `${url.toString().replace(/\/$/, '')}/${report.url_id}` }),
JSON.stringify({ url: `${url.toString().replace(/\/$/, '')}/${report.url_hash}` }),
{
status: 201
}