fix: return value
This commit is contained in:
parent
3739497a52
commit
88cf7b032b
1 changed files with 6 additions and 6 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue