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.
pull/22/head
gustavo.pinho 2024-02-01 18:49:06 -03:00
parent 6a5a51ff3f
commit c3ffab3819
3 changed files with 5 additions and 3 deletions

View File

@ -4,7 +4,7 @@ import Queue from "../../models/Queue";
const ShowUserService = async (id: string | number): Promise<User> => { const ShowUserService = async (id: string | number): Promise<User> => {
const user = await User.findByPk(id, { const user = await User.findByPk(id, {
attributes: ["name", "id", "email", "profile", "tokenVersion"], attributes: ["name", "id", "email", "profile", "positionCompany", "tokenVersion"],
include: [ include: [
{ model: Queue, as: "queues", attributes: ["id", "name", "color"] } { model: Queue, as: "queues", attributes: ["id", "name", "color"] }
], ],

View File

@ -8,6 +8,7 @@ interface UserData {
email?: string; email?: string;
password?: string; password?: string;
name?: string; name?: string;
positionCompany?: string;
profile?: string; profile?: string;
queueIds?: number[]; 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 { try {
await schema.validate({ email, password, profile, name }); await schema.validate({ email, password, profile, name });
@ -73,6 +74,7 @@ const UpdateUserService = async ({
email, email,
password, password,
profile, profile,
positionCompany,
name name
}); });

View File

@ -84,6 +84,7 @@ const UserModal = ({ open, onClose, userId }) => {
name: "", name: "",
email: "", email: "",
password: "", password: "",
positionCompany: "",
position: "", position: "",
profile: "user", profile: "user",
}; };
@ -235,7 +236,6 @@ const UserModal = ({ open, onClose, userId }) => {
<Field <Field
as={TextField} as={TextField}
label="Cargo" label="Cargo"
autoFocus
name="positionCompany" name="positionCompany"
error={touched.name && Boolean(errors.name)} error={touched.name && Boolean(errors.name)}
helperText={touched.name && errors.name} helperText={touched.name && errors.name}