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

This commit is contained in:
Brian Cao
2023-05-08 23:47:25 -07:00
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 {