From c3ffab38197c7eb572e9fd41e0921808ae8231ce Mon Sep 17 00:00:00 2001 From: "gustavo.pinho" Date: Thu, 1 Feb 2024 18:49:06 -0300 Subject: [PATCH] style: update job column display and enhance job editing Details: - Improved the presentation of the job column for better clarity. - Enhanced the functionality for editing job roles. --- backend/src/services/UserServices/ShowUserService.ts | 2 +- backend/src/services/UserServices/UpdateUserService.ts | 4 +++- frontend/src/components/UserModal/index.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/src/services/UserServices/ShowUserService.ts b/backend/src/services/UserServices/ShowUserService.ts index 03ecab4..3f2b501 100644 --- a/backend/src/services/UserServices/ShowUserService.ts +++ b/backend/src/services/UserServices/ShowUserService.ts @@ -4,7 +4,7 @@ import Queue from "../../models/Queue"; const ShowUserService = async (id: string | number): Promise => { const user = await User.findByPk(id, { - attributes: ["name", "id", "email", "profile", "tokenVersion"], + attributes: ["name", "id", "email", "profile", "positionCompany", "tokenVersion"], include: [ { model: Queue, as: "queues", attributes: ["id", "name", "color"] } ], diff --git a/backend/src/services/UserServices/UpdateUserService.ts b/backend/src/services/UserServices/UpdateUserService.ts index ed80cc2..8a0a4ba 100644 --- a/backend/src/services/UserServices/UpdateUserService.ts +++ b/backend/src/services/UserServices/UpdateUserService.ts @@ -8,6 +8,7 @@ interface UserData { email?: string; password?: string; name?: string; + positionCompany?: string; profile?: string; queueIds?: number[]; } @@ -60,7 +61,7 @@ const UpdateUserService = async ({ }); - const { email, password, profile, name, queueIds = [] } = userData; + const { email, password, profile, name, positionCompany, queueIds = [] } = userData; try { await schema.validate({ email, password, profile, name }); @@ -73,6 +74,7 @@ const UpdateUserService = async ({ email, password, profile, + positionCompany, name }); diff --git a/frontend/src/components/UserModal/index.js b/frontend/src/components/UserModal/index.js index 860cb2a..cd568e8 100644 --- a/frontend/src/components/UserModal/index.js +++ b/frontend/src/components/UserModal/index.js @@ -84,6 +84,7 @@ const UserModal = ({ open, onClose, userId }) => { name: "", email: "", password: "", + positionCompany: "", position: "", profile: "user", }; @@ -235,7 +236,6 @@ const UserModal = ({ open, onClose, userId }) => {