Convert /api/users.

This commit is contained in:
Mike Cao
2025-01-21 19:10:34 -08:00
parent 090abcff81
commit baa3851fb4
61 changed files with 1064 additions and 70 deletions

View File

@@ -0,0 +1,19 @@
import { canUpdateWebsite, checkAuth } from 'lib/auth';
import { resetWebsite } from 'queries';
import { unauthorized, ok } from 'lib/response';
export async function POST(
request: Request,
{ params }: { params: Promise<{ websiteId: string }> },
) {
const auth = await checkAuth(request);
const { websiteId } = await params;
if (!auth || !(await canUpdateWebsite(auth, websiteId))) {
return unauthorized();
}
await resetWebsite(websiteId);
return ok();
}