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
parent
6a5a51ff3f
commit
c3ffab3819
|
@ -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"] }
|
||||
],
|
||||
|
|
|
@ -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
|
||||
});
|
||||
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue