fix: return value

This commit is contained in:
Methapon2001 2024-04-04 16:22:28 +07:00
parent 3739497a52
commit 88cf7b032b

View file

@ -183,7 +183,7 @@ const useUserStore = defineStore('api-user', () => {
) {
const res = await api.post(
`/user/${userId}/branch`,
{ user: ([] as string[]).concat(branchId) },
{ branch: ([] as string[]).concat(branchId) },
{
headers: {
'X-Session-Id': flow?.sessionId,
@ -194,9 +194,9 @@ const useUserStore = defineStore('api-user', () => {
);
if (!res) return false;
if (res.status === 200) return res.data;
if (res.status >= 400) return false;
return false;
return res.data || true;
}
async function removeBranch(
@ -214,13 +214,13 @@ const useUserStore = defineStore('api-user', () => {
'X-Rtid': flow?.refTransactionId,
'X-Tid': flow?.transactionId,
},
data: { user: ([] as string[]).concat(branchId) },
data: { branch: ([] as string[]).concat(branchId) },
});
if (!res) return false;
if (res.status === 200) return res.data;
if (res.status >= 400) return false;
return false;
return res.data || true;
}
return {