# Conflicts:
#	pages/api/account/index.js
This commit is contained in:
Mike Cao 2022-10-03 17:17:53 -07:00
commit d784b2a8db
31 changed files with 178 additions and 149 deletions

View file

@ -0,0 +1,20 @@
import { resetWebsite } from 'queries';
import { methodNotAllowed, ok, unauthorized } from 'next-basics';
import { allowQuery } from 'lib/auth';
export default async (req, res) => {
const { id } = req.query;
const websiteId = +id;
if (req.method === 'POST') {
if (!(await allowQuery(req))) {
return unauthorized(res);
}
await resetWebsite(websiteId);
return ok(res);
}
return methodNotAllowed(res);
};