diff --git a/frontend/src/components/Ticket/index.js b/frontend/src/components/Ticket/index.js index ce24b43..44a6555 100644 --- a/frontend/src/components/Ticket/index.js +++ b/frontend/src/components/Ticket/index.js @@ -73,13 +73,11 @@ const Ticket = () => { const socketManager = useContext(SocketContext); useEffect(() => { - api.get(`/settings`).then(({ data }) => { - if (Array.isArray(data)) { - const ignoreGroups = data.find((d) => d.key === "CheckMsgIsGroup"); - const groupsTab = data.find((d) => d.key === "groupsTab"); - - setShowTabGroups(!(ignoreGroups?.value !== "disabled") && groupsTab?.value === "enabled"); - } + Promise.all([ + api.get("/company-settings/CheckMsgIsGroup"), + api.get("/company-settings/groupsTab") + ]).then(([ignoreGroups, groupsTab]) => { + setShowTabGroups(!(ignoreGroups?.data !== "disabled") && groupsTab?.data === "enabled"); }); }, []); diff --git a/frontend/src/components/TicketsManagerTabs/index.js b/frontend/src/components/TicketsManagerTabs/index.js index e663f70..214909b 100644 --- a/frontend/src/components/TicketsManagerTabs/index.js +++ b/frontend/src/components/TicketsManagerTabs/index.js @@ -131,13 +131,11 @@ const TicketsManagerTabs = () => { const [showTabGroups, setShowTabGroups] = useState(false); useEffect(() => { - api.get(`/settings`).then(({ data }) => { - if (Array.isArray(data)) { - const ignoreGroups = data.find((d) => d.key === "CheckMsgIsGroup"); - const groupsTab = data.find((d) => d.key === "groupsTab"); - - setShowTabGroups(!(ignoreGroups?.value !== "disabled") && groupsTab?.value === "enabled"); - } + Promise.all([ + api.get("/company-settings/CheckMsgIsGroup"), + api.get("/company-settings/groupsTab") + ]).then(([ignoreGroups, groupsTab]) => { + setShowTabGroups(!(ignoreGroups?.data !== "disabled") && groupsTab?.data === "enabled"); }); }, []);