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,
|
||||
createUser,
|
||||
deleteUser,
|
||||
editUser,
|
||||
getRoles,
|
||||
getUserRoles,
|
||||
removeUserRoles,
|
||||
|
|
@ -77,6 +78,8 @@ type UserCreate = {
|
|||
type UserUpdate = {
|
||||
status?: "ACTIVE" | "INACTIVE";
|
||||
|
||||
username?: string;
|
||||
|
||||
userType?: UserType;
|
||||
userRole?: string;
|
||||
|
||||
|
|
@ -373,6 +376,10 @@ export class UserController extends Controller {
|
|||
userRole = role.name;
|
||||
}
|
||||
|
||||
if (body.username) {
|
||||
await editUser(userId, { username: body.username });
|
||||
}
|
||||
|
||||
const { provinceId, districtId, subDistrictId, ...rest } = body;
|
||||
|
||||
const user = await prisma.user.findFirst({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue