Merge branch 'dev' of https://github.com/umami-software/umami into feat/um-171-cloud-mode-env-variable

This commit is contained in:
Francis Cao 2023-03-01 11:40:34 -08:00
commit a777b2916f
88 changed files with 1014 additions and 945 deletions

View file

@ -2,10 +2,10 @@ import { canCreateUser, canViewUsers } from 'lib/auth';
import { ROLES } from 'lib/constants';
import { uuid } from 'lib/crypto';
import { useAuth } from 'lib/middleware';
import { NextApiRequestQueryBody } from 'lib/types';
import { NextApiRequestQueryBody, User } from 'lib/types';
import { NextApiResponse } from 'next';
import { badRequest, hashPassword, methodNotAllowed, ok, unauthorized } from 'next-basics';
import { createUser, getUser, getUsers, User } from 'queries';
import { createUser, getUser, getUsers } from 'queries';
export interface UsersRequestBody {
username: string;
@ -36,7 +36,7 @@ export default async (
const { username, password, id } = req.body;
const existingUser = await getUser({ username });
const existingUser = await getUser({ username }, { showDeleted: true });
if (existingUser) {
return badRequest(res, 'User already exists');