Merge branch 'dev' into feat/um-285-report-schema

This commit is contained in:
Brian Cao 2023-05-08 23:47:25 -07:00
commit dd2db308ee
7 changed files with 48 additions and 42 deletions

View file

@ -51,11 +51,11 @@ export default async (
data.password = hashPassword(password);
}
// Only admin can change these fields
if (role && isAdmin) {
data.role = role;
}
// Only admin can change these fields
if (username && isAdmin) {
data.username = username;
}

View file

@ -1,8 +1,8 @@
import { NextApiResponse } from 'next';
import { methodNotAllowed, ok, serverError, unauthorized } from 'next-basics';
import { Website, NextApiRequestQueryBody } from 'lib/types';
import { canViewWebsite, canUpdateWebsite, canDeleteWebsite } from 'lib/auth';
import { useAuth, useCors } from 'lib/middleware';
import { NextApiResponse } from 'next';
import { methodNotAllowed, ok, serverError, unauthorized } from 'next-basics';
import { deleteWebsite, getWebsite, updateWebsite } from 'queries';
export interface WebsiteRequestQuery {