Feat/um 62 prisma property names (#1562)
* checkpoint * fix pg schema * fix mysql schema * change property names
This commit is contained in:
@@ -37,7 +37,7 @@ export default async (req, res) => {
|
||||
// Only admin can change these fields
|
||||
if (currentUserIsAdmin) {
|
||||
data.username = username;
|
||||
data.is_admin = is_admin;
|
||||
data.isAdmin = is_admin;
|
||||
}
|
||||
|
||||
// Check when username changes
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
export default async (req, res) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
const { user_id: currentUserId, is_admin: currentUserIsAdmin } = req.auth;
|
||||
const { userId: currentUserId, isAdmin: currentUserIsAdmin } = req.auth;
|
||||
const { current_password, new_password } = req.body;
|
||||
const { id } = req.query;
|
||||
const userId = +id;
|
||||
|
||||
@@ -6,9 +6,9 @@ import { createAccount, getAccountByUsername, getAccounts } from 'queries';
|
||||
export default async (req, res) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
const { is_admin } = req.auth;
|
||||
const { isAdmin } = req.auth;
|
||||
|
||||
if (!is_admin) {
|
||||
if (!isAdmin) {
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ export default async (req, res) => {
|
||||
const created = await createAccount({
|
||||
username,
|
||||
password: hashPassword(password),
|
||||
account_uuid: account_uuid || uuid(),
|
||||
accountUuid: account_uuid || uuid(),
|
||||
});
|
||||
|
||||
return ok(res, created);
|
||||
|
||||
Reference in New Issue
Block a user