From e197e15ef03da16e02fdc89b8c78821ff7d402a7 Mon Sep 17 00:00:00 2001 From: Brian Cao Date: Wed, 26 Jul 2023 10:49:19 -0700 Subject: [PATCH] Update reset website logic. --- pages/api/websites/[id]/reset.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/api/websites/[id]/reset.ts b/pages/api/websites/[id]/reset.ts index dc98c591..23b5305d 100644 --- a/pages/api/websites/[id]/reset.ts +++ b/pages/api/websites/[id]/reset.ts @@ -1,5 +1,5 @@ import { NextApiRequestQueryBody } from 'lib/types'; -import { canViewWebsite } from 'lib/auth'; +import { canUpdateWebsite } from 'lib/auth'; import { useAuth, useCors } from 'lib/middleware'; import { NextApiResponse } from 'next'; import { methodNotAllowed, ok, unauthorized } from 'next-basics'; @@ -19,7 +19,7 @@ export default async ( const { id: websiteId } = req.query; if (req.method === 'POST') { - if (!(await canViewWebsite(req.auth, websiteId))) { + if (!(await canUpdateWebsite(req.auth, websiteId))) { return unauthorized(res); }