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;
|
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(
|
async function createBranch(
|
||||||
data: CustomerBranchCreate & { customerId: string },
|
data: CustomerBranchCreate & { customerId: string },
|
||||||
flow?: {
|
flow?: {
|
||||||
|
|
@ -467,6 +487,7 @@ const useCustomerStore = defineStore('api-customer', () => {
|
||||||
editById,
|
editById,
|
||||||
deleteById,
|
deleteById,
|
||||||
createBranch,
|
createBranch,
|
||||||
|
getBranchById,
|
||||||
editBranchById,
|
editBranchById,
|
||||||
deleteBranchById,
|
deleteBranchById,
|
||||||
fetchListCustomeBranchById,
|
fetchListCustomeBranchById,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue