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 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"] }
],

View File

@ -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
});

View File

@ -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 }) => {
<Field
as={TextField}
label="Cargo"
autoFocus
name="positionCompany"
error={touched.name && Boolean(errors.name)}
helperText={touched.name && errors.name}