fix: missing parameter username on edit
This commit is contained in:
parent
4750f1945d
commit
fb158b2457
1 changed files with 7 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ import {
|
||||||
addUserRoles,
|
addUserRoles,
|
||||||
createUser,
|
createUser,
|
||||||
deleteUser,
|
deleteUser,
|
||||||
|
editUser,
|
||||||
getRoles,
|
getRoles,
|
||||||
getUserRoles,
|
getUserRoles,
|
||||||
removeUserRoles,
|
removeUserRoles,
|
||||||
|
|
@ -77,6 +78,8 @@ type UserCreate = {
|
||||||
type UserUpdate = {
|
type UserUpdate = {
|
||||||
status?: "ACTIVE" | "INACTIVE";
|
status?: "ACTIVE" | "INACTIVE";
|
||||||
|
|
||||||
|
username?: string;
|
||||||
|
|
||||||
userType?: UserType;
|
userType?: UserType;
|
||||||
userRole?: string;
|
userRole?: string;
|
||||||
|
|
||||||
|
|
@ -373,6 +376,10 @@ export class UserController extends Controller {
|
||||||
userRole = role.name;
|
userRole = role.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (body.username) {
|
||||||
|
await editUser(userId, { username: body.username });
|
||||||
|
}
|
||||||
|
|
||||||
const { provinceId, districtId, subDistrictId, ...rest } = body;
|
const { provinceId, districtId, subDistrictId, ...rest } = body;
|
||||||
|
|
||||||
const user = await prisma.user.findFirst({
|
const user = await prisma.user.findFirst({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue