diff --git a/backend/src/models/Queue.ts b/backend/src/models/Queue.ts index 334abb2..c5c06d9 100644 --- a/backend/src/models/Queue.ts +++ b/backend/src/models/Queue.ts @@ -8,8 +8,7 @@ import { AutoIncrement, AllowNull, Unique, - BelongsToMany, - HasMany + BelongsToMany } from "sequelize-typescript"; import User from "./User"; import UserQueue from "./UserQueue"; diff --git a/frontend/src/components/Can/index.js b/frontend/src/components/Can/index.js index 9d9e27a..3d80215 100644 --- a/frontend/src/components/Can/index.js +++ b/frontend/src/components/Can/index.js @@ -1,6 +1,6 @@ -import rules from "../../accessRules"; +import rules from "../../rules"; -const check = (rules, role, action, data) => { +const check = (role, action, data) => { const permissions = rules[role]; if (!permissions) { // role is not present in the rules @@ -29,7 +29,7 @@ const check = (rules, role, action, data) => { }; const Can = ({ role, perform, data, yes, no }) => - check(rules, role, perform, data) ? yes() : no(); + check(role, perform, data) ? yes() : no(); Can.defaultProps = { yes: () => null, diff --git a/frontend/src/components/ColorPicker/index.js b/frontend/src/components/ColorPicker/index.js index fb6c825..b89b233 100644 --- a/frontend/src/components/ColorPicker/index.js +++ b/frontend/src/components/ColorPicker/index.js @@ -4,10 +4,10 @@ import React, { useState } from "react"; import { GithubPicker } from "react-color"; const ColorPicker = ({ onChange, currentColor, handleClose, open }) => { - const [color, setColor] = useState(currentColor); + const [selectedColor, setSelectedColor] = useState(currentColor); const handleChange = color => { - setColor(color.hex); + setSelectedColor(color.hex); handleClose(); }; @@ -20,7 +20,7 @@ const ColorPicker = ({ onChange, currentColor, handleClose, open }) => { onChange(color.hex)} /> diff --git a/frontend/src/components/WhatsAppModal/index.js b/frontend/src/components/WhatsAppModal/index.js index 853b8bd..b7ae1d9 100644 --- a/frontend/src/components/WhatsAppModal/index.js +++ b/frontend/src/components/WhatsAppModal/index.js @@ -178,7 +178,7 @@ const WhatsAppModal = ({ open, onClose, whatsAppId }) => { setSelectedQueueIds(values)} + onChange={selectedIds => setSelectedQueueIds(selectedIds)} /> diff --git a/frontend/src/context/Auth/useAuth.js b/frontend/src/context/Auth/useAuth.js index 30b79f9..c2fe418 100644 --- a/frontend/src/context/Auth/useAuth.js +++ b/frontend/src/context/Auth/useAuth.js @@ -84,11 +84,11 @@ const useAuth = () => { }; }, [user]); - const handleLogin = async user => { + const handleLogin = async userData => { setLoading(true); try { - const { data } = await api.post("/auth/login", user); + const { data } = await api.post("/auth/login", userData); localStorage.setItem("token", JSON.stringify(data.token)); api.defaults.headers.Authorization = `Bearer ${data.token}`; setUser(data.user); diff --git a/frontend/src/layout/MainListItems.js b/frontend/src/layout/MainListItems.js index e8e68b2..ebffadc 100644 --- a/frontend/src/layout/MainListItems.js +++ b/frontend/src/layout/MainListItems.js @@ -50,15 +50,13 @@ const MainListItems = () => { const delayDebounceFn = setTimeout(() => { if (whatsApps.length > 0) { const offlineWhats = whatsApps.filter(whats => { - if ( + return ( whats.status === "qrcode" || whats.status === "PAIRING" || whats.status === "DISCONNECTED" || whats.status === "TIMEOUT" || whats.status === "OPENING" - ) - return true; - else return false; + ); }); if (offlineWhats.length > 0) { setConnectionWarning(true); diff --git a/frontend/src/accessRules.js b/frontend/src/rules.js similarity index 100% rename from frontend/src/accessRules.js rename to frontend/src/rules.js