feat: add flow store
This commit is contained in:
parent
02c5aa2a1c
commit
44ae39907e
7 changed files with 83 additions and 55 deletions
|
|
@ -4,10 +4,12 @@ import { defineStore } from 'pinia';
|
|||
import { BranchContact, BranchContactCreate } from './types';
|
||||
import { Pagination } from '../types';
|
||||
import { api } from 'src/boot/axios';
|
||||
import useFlowStore from '../flow';
|
||||
|
||||
type BranchContactId = string;
|
||||
|
||||
const useBranchContactStore = defineStore('api-branch-contact', () => {
|
||||
const flowStore = useFlowStore();
|
||||
const data = ref<Pagination<BranchContact[]>>({
|
||||
result: [],
|
||||
page: 0,
|
||||
|
|
@ -48,7 +50,7 @@ const useBranchContactStore = defineStore('api-branch-contact', () => {
|
|||
{
|
||||
headers: {
|
||||
'X-Session-Id': flow?.sessionId,
|
||||
'X-Rtid': flow?.refTransactionId,
|
||||
'X-Rtid': flow?.refTransactionId || flowStore.rtid,
|
||||
'X-Tid': flow?.transactionId,
|
||||
},
|
||||
},
|
||||
|
|
@ -75,7 +77,7 @@ const useBranchContactStore = defineStore('api-branch-contact', () => {
|
|||
>(`/branch/${branchId}/contact`, data, {
|
||||
headers: {
|
||||
'X-Session-Id': flow?.sessionId,
|
||||
'X-Rtid': flow?.refTransactionId,
|
||||
'X-Rtid': flow?.refTransactionId || flowStore.rtid,
|
||||
'X-Tid': flow?.transactionId,
|
||||
},
|
||||
});
|
||||
|
|
@ -104,7 +106,7 @@ const useBranchContactStore = defineStore('api-branch-contact', () => {
|
|||
{
|
||||
headers: {
|
||||
'X-Session-Id': flow?.sessionId,
|
||||
'X-Rtid': flow?.refTransactionId,
|
||||
'X-Rtid': flow?.refTransactionId || flowStore.rtid,
|
||||
'X-Tid': flow?.transactionId,
|
||||
},
|
||||
},
|
||||
|
|
@ -138,7 +140,7 @@ const useBranchContactStore = defineStore('api-branch-contact', () => {
|
|||
>(`/branch/${branchId}/contact/${contactId}`, {
|
||||
headers: {
|
||||
'X-Session-Id': flow?.sessionId,
|
||||
'X-Rtid': flow?.refTransactionId,
|
||||
'X-Rtid': flow?.refTransactionId || flowStore.rtid,
|
||||
'X-Tid': flow?.transactionId,
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue