Skip to content

Commit

Permalink
use correct endpoint to get group config settings
Browse files Browse the repository at this point in the history
  • Loading branch information
allgood committed Nov 14, 2024
1 parent d088018 commit 3c4b6d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
12 changes: 5 additions & 7 deletions frontend/src/components/Ticket/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
}, []);

Expand Down
12 changes: 5 additions & 7 deletions frontend/src/components/TicketsManagerTabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
}, []);

Expand Down

0 comments on commit 3c4b6d6

Please sign in to comment.