feat: add api get method function
This commit is contained in:
parent
1134ca5210
commit
301dcc32aa
1 changed files with 21 additions and 0 deletions
|
|
@ -299,6 +299,26 @@ const useCustomerStore = defineStore('api-customer', () => {
|
|||
return false;
|
||||
}
|
||||
|
||||
async function getBranchById(
|
||||
id: string,
|
||||
flow?: {
|
||||
sessionId?: string;
|
||||
refTransactionId?: string;
|
||||
transactionId?: string;
|
||||
},
|
||||
) {
|
||||
const res = await api.post<CustomerBranch>(`/customer-branch/${id}`, {
|
||||
headers: {
|
||||
'X-Session-Id': flow?.sessionId,
|
||||
'X-Rtid': flow?.refTransactionId || flowStore.rtid,
|
||||
'X-Tid': flow?.transactionId,
|
||||
},
|
||||
});
|
||||
if (!res) return false;
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
async function createBranch(
|
||||
data: CustomerBranchCreate & { customerId: string },
|
||||
flow?: {
|
||||
|
|
@ -467,6 +487,7 @@ const useCustomerStore = defineStore('api-customer', () => {
|
|||
editById,
|
||||
deleteById,
|
||||
createBranch,
|
||||
getBranchById,
|
||||
editBranchById,
|
||||
deleteBranchById,
|
||||
fetchListCustomeBranchById,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue