diff --git a/src/stores/customer/index.ts b/src/stores/customer/index.ts index 4f273502..af89ec07 100644 --- a/src/stores/customer/index.ts +++ b/src/stores/customer/index.ts @@ -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(`/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,