Compare commits
No commits in common. "8eb2156845d0aebdd1eba1a671319534fd89ba6c" and "4a6fb3f61e864d9fecd7db95d400449182c801bb" have entirely different histories.
8eb2156845
...
4a6fb3f61e
|
@ -43,7 +43,8 @@ export const createUser = async (
|
|||
const user = await CreateUserService({
|
||||
email: user_tax_id || user_email,
|
||||
password: "12345",
|
||||
name: user_first_name,
|
||||
name: user_first_name,
|
||||
positionCompany: user_title,
|
||||
profile: "user",
|
||||
ignoreThrow: true
|
||||
});
|
||||
|
@ -203,7 +204,8 @@ export const updateUser = async (
|
|||
|
||||
const userData = {
|
||||
email: user_tax_id || user_email,
|
||||
name: user_first_name,
|
||||
name: user_first_name,
|
||||
positionCompany: user_title
|
||||
};
|
||||
|
||||
let user: any = await UpdateUserService({
|
||||
|
|
|
@ -142,7 +142,8 @@ export const store = async (req: Request, res: Response): Promise<Response> => {
|
|||
email,
|
||||
password,
|
||||
name,
|
||||
profile,
|
||||
profile,
|
||||
positionCompany,
|
||||
positionId,
|
||||
queueIds,
|
||||
transferToOtherQueues
|
||||
|
@ -168,7 +169,8 @@ export const store = async (req: Request, res: Response): Promise<Response> => {
|
|||
const user = await CreateUserService({
|
||||
email,
|
||||
password,
|
||||
name,
|
||||
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
|
||||
});
|
||||
}
|
||||
};
|
|
@ -3,7 +3,8 @@ import User from "../models/User";
|
|||
|
||||
interface SerializedUser {
|
||||
id: number;
|
||||
name: string;
|
||||
name: string;
|
||||
positionCompany: string;
|
||||
positionId: string | number;
|
||||
position: object;
|
||||
email: string;
|
||||
|
@ -14,7 +15,8 @@ interface SerializedUser {
|
|||
export const SerializeUser = (user: User): SerializedUser => {
|
||||
return {
|
||||
id: user.id,
|
||||
name: user.name,
|
||||
name: user.name,
|
||||
positionCompany: user.positionCompany,
|
||||
positionId: user.positionId,
|
||||
position: user.position,
|
||||
email: user.email,
|
||||
|
|
|
@ -43,7 +43,10 @@ class User extends Model<User> {
|
|||
|
||||
@Default(0)
|
||||
@Column
|
||||
tokenVersion: number;
|
||||
tokenVersion: number;
|
||||
|
||||
@Column
|
||||
positionCompany: string;
|
||||
|
||||
@Column
|
||||
secondaryId: string;
|
||||
|
|
|
@ -9,7 +9,8 @@ import Queue from "../../models/Queue";
|
|||
|
||||
interface SerializedUser {
|
||||
id: number;
|
||||
name: string;
|
||||
name: string;
|
||||
positionCompany: string;
|
||||
email: string;
|
||||
profile: string;
|
||||
queues: Queue[];
|
||||
|
|
|
@ -8,7 +8,8 @@ import ShowUserService from "./ShowUserService";
|
|||
interface Request {
|
||||
email: string;
|
||||
password: string;
|
||||
name: string;
|
||||
name: string;
|
||||
positionCompany?: string;
|
||||
positionId?: string;
|
||||
queueIds?: number[];
|
||||
profile?: string;
|
||||
|
@ -18,7 +19,8 @@ interface Request {
|
|||
|
||||
interface Response {
|
||||
email: string;
|
||||
name: string;
|
||||
name: string;
|
||||
positionCompany: string;
|
||||
positionId: string;
|
||||
id: number;
|
||||
profile: string;
|
||||
|
@ -28,7 +30,8 @@ interface Response {
|
|||
const CreateUserService = async ({
|
||||
email,
|
||||
password,
|
||||
name,
|
||||
name,
|
||||
positionCompany,
|
||||
positionId,
|
||||
queueIds = [],
|
||||
profile = "master",
|
||||
|
@ -81,7 +84,8 @@ const CreateUserService = async ({
|
|||
{
|
||||
email,
|
||||
password,
|
||||
name,
|
||||
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"] }
|
||||
|
|
|
@ -63,7 +63,8 @@ const ListUsersService = async ({
|
|||
attributes: [
|
||||
"name",
|
||||
"id",
|
||||
"email",
|
||||
"email",
|
||||
"positionCompany",
|
||||
"profile",
|
||||
"createdAt",
|
||||
"transferToOtherQueues"
|
||||
|
|
|
@ -9,7 +9,8 @@ const ShowUserService = async (id: string | number): Promise<User> => {
|
|||
"name",
|
||||
"id",
|
||||
"email",
|
||||
"profile",
|
||||
"profile",
|
||||
"positionCompany",
|
||||
"positionId",
|
||||
"tokenVersion",
|
||||
"transferToOtherQueues"
|
||||
|
|
|
@ -7,7 +7,8 @@ import User from "../../models/User";
|
|||
interface UserData {
|
||||
email?: string;
|
||||
password?: string;
|
||||
name?: string;
|
||||
name?: string;
|
||||
positionCompany?: string;
|
||||
positionId?: string;
|
||||
profile?: string;
|
||||
queueIds?: number[];
|
||||
|
@ -72,7 +73,8 @@ const UpdateUserService = async ({
|
|||
email,
|
||||
password,
|
||||
profile,
|
||||
name,
|
||||
name,
|
||||
positionCompany,
|
||||
positionId,
|
||||
queueIds = [],
|
||||
transferToOtherQueues
|
||||
|
@ -87,7 +89,8 @@ const UpdateUserService = async ({
|
|||
await user.update({
|
||||
email,
|
||||
password,
|
||||
profile,
|
||||
profile,
|
||||
positionCompany,
|
||||
positionId: !positionId ? null : positionId,
|
||||
name,
|
||||
transferToOtherQueues
|
||||
|
|
|
@ -84,7 +84,8 @@ const UserModal = ({ open, onClose, userId, }) => {
|
|||
const initialState = {
|
||||
name: "",
|
||||
email: "",
|
||||
password: "",
|
||||
password: "",
|
||||
positionCompany: "",
|
||||
profile: "user",
|
||||
}
|
||||
|
||||
|
@ -260,7 +261,17 @@ const UserModal = ({ open, onClose, userId, }) => {
|
|||
margin="dense"
|
||||
fullWidth
|
||||
/>
|
||||
<div className={classes.multFieldLine}>
|
||||
<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