mirror of
https://github.com/mudabbir-ahmad/MAD-Treasure-Hunt.git
synced 2026-10-08 03:00:20 +00:00
Enhance department management: add department name display in cache cards, update navigation to include selected department, and improve department selection in map screen.
This commit is contained in:
1 parent
dd5dd83737
commit
43c8bb2bff
5 files changed
+121
-9
No files matched your search
@@ -43,7 +43,9 @@ const useGameHook = () => {
|
||||
|
||||
// Look up a group by its Organisation Join Code
|
||||
const getGroupByOrgCode = async (code) => {
|
||||
const response = await API.get(`${groupsEndpoint}?OrgJoinCode=${code}`);
|
||||
const normalizedCode = String(code || '').trim().toUpperCase();
|
||||
if (!normalizedCode) return null;
|
||||
const response = await API.get(`${groupsEndpoint}?OrgJoinCode=${encodeURIComponent(normalizedCode)}`);
|
||||
if (response.isSuccess && response.result.length > 0) return response.result[0];
|
||||
return null;
|
||||
};
|
||||
@@ -76,7 +78,14 @@ const useGameHook = () => {
|
||||
|
||||
// Subgroup members
|
||||
const joinPrivateGame = async (payload) => {
|
||||
const response = await API.post(subgroupMembersEndpoint, payload);
|
||||
const data = {
|
||||
JoinCode: payload.JoinCode,
|
||||
Uid: payload.Uid,
|
||||
};
|
||||
if (payload.ExpectedGid !== undefined && payload.ExpectedGid !== null) {
|
||||
data.ExpectedGid = payload.ExpectedGid;
|
||||
}
|
||||
const response = await API.post(subgroupMembersEndpoint, data);
|
||||
return response.isSuccess ? response.result : null;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user