Compare commits
No commits in common. "8eb2156845d0aebdd1eba1a671319534fd89ba6c" and "4a6fb3f61e864d9fecd7db95d400449182c801bb" have entirely different histories.
8eb2156845
...
4a6fb3f61e
|
@ -44,6 +44,7 @@ export const createUser = async (
|
|||
email: user_tax_id || user_email,
|
||||
password: "12345",
|
||||
name: user_first_name,
|
||||
positionCompany: user_title,
|
||||
profile: "user",
|
||||
ignoreThrow: true
|
||||
});
|
||||
|
@ -204,6 +205,7 @@ export const updateUser = async (
|
|||
const userData = {
|
||||
email: user_tax_id || user_email,
|
||||
name: user_first_name,
|
||||
positionCompany: user_title
|
||||
};
|
||||
|
||||
let user: any = await UpdateUserService({
|
||||
|
|
|
@ -143,6 +143,7 @@ export const store = async (req: Request, res: Response): Promise<Response> => {
|
|||
password,
|
||||
name,
|
||||
profile,
|
||||
positionCompany,
|
||||
positionId,
|
||||
queueIds,
|
||||
transferToOtherQueues
|
||||
|
@ -169,6 +170,7 @@ export const store = async (req: Request, res: Response): Promise<Response> => {
|
|||
email,
|
||||
password,
|
||||
name,
|
||||
positionCompany,
|
||||
positionId,
|
||||
profile,
|
||||
queueIds,
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
import { QueryInterface, DataTypes } from "sequelize";
|
||||
|
||||
module.exports = {
|
||||
up: (queryInterface: QueryInterface) => {
|
||||
return queryInterface.removeColumn("Users", "positionCompany");
|
||||
},
|
||||
|
||||
down: (queryInterface: QueryInterface) => {
|
||||
return queryInterface.addColumn("Users", "positionCompany", {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true
|
||||
});
|
||||
}
|
||||
};
|
|
@ -4,6 +4,7 @@ import User from "../models/User";
|
|||
interface SerializedUser {
|
||||
id: number;
|
||||
name: string;
|
||||
positionCompany: string;
|
||||
positionId: string | number;
|
||||
position: object;
|
||||
email: string;
|
||||
|
@ -15,6 +16,7 @@ export const SerializeUser = (user: User): SerializedUser => {
|
|||
return {
|
||||
id: user.id,
|
||||
name: user.name,
|
||||
positionCompany: user.positionCompany,
|
||||
positionId: user.positionId,
|
||||
position: user.position,
|
||||
email: user.email,
|
||||
|
|
|
@ -45,6 +45,9 @@ class User extends Model<User> {
|
|||
@Column
|
||||
tokenVersion: number;
|
||||
|
||||
@Column
|
||||
positionCompany: string;
|
||||
|
||||
@Column
|
||||
secondaryId: string;
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import Queue from "../../models/Queue";
|
|||
interface SerializedUser {
|
||||
id: number;
|
||||
name: string;
|
||||
positionCompany: string;
|
||||
email: string;
|
||||
profile: string;
|
||||
queues: Queue[];
|
||||
|
|
|
@ -9,6 +9,7 @@ interface Request {
|
|||
email: string;
|
||||
password: string;
|
||||
name: string;
|
||||
positionCompany?: string;
|
||||
positionId?: string;
|
||||
queueIds?: number[];
|
||||
profile?: string;
|
||||
|
@ -19,6 +20,7 @@ interface Request {
|
|||
interface Response {
|
||||
email: string;
|
||||
name: string;
|
||||
positionCompany: string;
|
||||
positionId: string;
|
||||
id: number;
|
||||
profile: string;
|
||||
|
@ -29,6 +31,7 @@ const CreateUserService = async ({
|
|||
email,
|
||||
password,
|
||||
name,
|
||||
positionCompany,
|
||||
positionId,
|
||||
queueIds = [],
|
||||
profile = "master",
|
||||
|
@ -82,6 +85,7 @@ const CreateUserService = async ({
|
|||
email,
|
||||
password,
|
||||
name,
|
||||
positionCompany,
|
||||
positionId: !positionId ? null : positionId,
|
||||
profile,
|
||||
transferToOtherQueues: transferToOtherQueues? transferToOtherQueues : false
|
||||
|
|
|
@ -75,7 +75,7 @@ const ListUser = async ({
|
|||
const users = await User.findAll({
|
||||
where: where_clause,
|
||||
raw,
|
||||
attributes: ["id", "name", "email", "transferToOtherQueues"],
|
||||
attributes: ["id", "name", "email", "positionCompany", "transferToOtherQueues"],
|
||||
|
||||
include: [
|
||||
{ model: Queue, as: "queues", attributes: ["id", "name", "color"] }
|
||||
|
|
|
@ -64,6 +64,7 @@ const ListUsersService = async ({
|
|||
"name",
|
||||
"id",
|
||||
"email",
|
||||
"positionCompany",
|
||||
"profile",
|
||||
"createdAt",
|
||||
"transferToOtherQueues"
|
||||
|
|
|
@ -10,6 +10,7 @@ const ShowUserService = async (id: string | number): Promise<User> => {
|
|||
"id",
|
||||
"email",
|
||||
"profile",
|
||||
"positionCompany",
|
||||
"positionId",
|
||||
"tokenVersion",
|
||||
"transferToOtherQueues"
|
||||
|
|
|
@ -8,6 +8,7 @@ interface UserData {
|
|||
email?: string;
|
||||
password?: string;
|
||||
name?: string;
|
||||
positionCompany?: string;
|
||||
positionId?: string;
|
||||
profile?: string;
|
||||
queueIds?: number[];
|
||||
|
@ -73,6 +74,7 @@ const UpdateUserService = async ({
|
|||
password,
|
||||
profile,
|
||||
name,
|
||||
positionCompany,
|
||||
positionId,
|
||||
queueIds = [],
|
||||
transferToOtherQueues
|
||||
|
@ -88,6 +90,7 @@ const UpdateUserService = async ({
|
|||
email,
|
||||
password,
|
||||
profile,
|
||||
positionCompany,
|
||||
positionId: !positionId ? null : positionId,
|
||||
name,
|
||||
transferToOtherQueues
|
||||
|
|
|
@ -85,6 +85,7 @@ const UserModal = ({ open, onClose, userId, }) => {
|
|||
name: "",
|
||||
email: "",
|
||||
password: "",
|
||||
positionCompany: "",
|
||||
profile: "user",
|
||||
}
|
||||
|
||||
|
@ -261,6 +262,16 @@ const UserModal = ({ open, onClose, userId, }) => {
|
|||
fullWidth
|
||||
/>
|
||||
<div className={classes.multFieldLine}>
|
||||
{/* <Field
|
||||
as={TextField}
|
||||
label="Cargo"
|
||||
name="positionCompany"
|
||||
error={touched.name && Boolean(errors.name)}
|
||||
helperText={touched.name && errors.name}
|
||||
variant="outlined"
|
||||
margin="dense"
|
||||
fullWidth
|
||||
/> */}
|
||||
<label style={{display: 'flex', alignItems:'center'}}>
|
||||
Transferir para outras filas
|
||||
<Switch
|
||||
|
|
Loading…
Reference in New Issue