refactor: remove unneccesary
This commit is contained in:
parent
9f06147ab1
commit
01c5592f7d
1 changed files with 4 additions and 24 deletions
|
|
@ -22,14 +22,7 @@ const useMyBranch = defineStore('useMyBranchStore', () => {
|
||||||
filter?: 'head' | 'sub';
|
filter?: 'head' | 'sub';
|
||||||
},
|
},
|
||||||
Data extends Pagination<Branch[]>,
|
Data extends Pagination<Branch[]>,
|
||||||
>(
|
>(opts?: Options): Promise<Data | false> {
|
||||||
opts?: Options,
|
|
||||||
flow?: {
|
|
||||||
sessionId?: string;
|
|
||||||
refTransactionId?: string;
|
|
||||||
transactionId?: string;
|
|
||||||
},
|
|
||||||
): Promise<Data | false> {
|
|
||||||
const params = new URLSearchParams();
|
const params = new URLSearchParams();
|
||||||
|
|
||||||
for (const [k, v] of Object.entries(opts || {})) {
|
for (const [k, v] of Object.entries(opts || {})) {
|
||||||
|
|
@ -41,11 +34,7 @@ const useMyBranch = defineStore('useMyBranchStore', () => {
|
||||||
const res = await api.get<Data>(
|
const res = await api.get<Data>(
|
||||||
`/branch${(params && '?'.concat(query)) || ''}`,
|
`/branch${(params && '?'.concat(query)) || ''}`,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: { 'X-Rtid': flowStore.rtid },
|
||||||
'X-Session-Id': flow?.sessionId,
|
|
||||||
'X-Rtid': flow?.refTransactionId || flowStore.rtid,
|
|
||||||
'X-Tid': flow?.transactionId,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -55,19 +44,10 @@ const useMyBranch = defineStore('useMyBranchStore', () => {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchListMyBranch(
|
async function fetchListMyBranch(userId: string) {
|
||||||
userId: string,
|
|
||||||
flow?: {
|
|
||||||
sessionId?: string;
|
|
||||||
refTransactionId?: string;
|
|
||||||
transactionId?: string;
|
|
||||||
},
|
|
||||||
) {
|
|
||||||
const res = await api.get<Pagination<Branch[]>>(`/user/${userId}/branch`, {
|
const res = await api.get<Pagination<Branch[]>>(`/user/${userId}/branch`, {
|
||||||
headers: {
|
headers: {
|
||||||
'X-Session-Id': flow?.sessionId,
|
'X-Rtid': flowStore.rtid,
|
||||||
'X-Rtid': flow?.refTransactionId || flowStore.rtid,
|
|
||||||
'X-Tid': flow?.transactionId,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue