feat: bankbook & i18n
This commit is contained in:
parent
5f26c8bcdc
commit
912fb7c4c3
9 changed files with 458 additions and 34 deletions
|
|
@ -2,7 +2,7 @@ import { ref, watch } from 'vue';
|
|||
import { defineStore } from 'pinia';
|
||||
import { Pagination } from '../types';
|
||||
import { api } from 'src/boot/axios';
|
||||
import { Branch, BranchCreate } from './types';
|
||||
import { BankBook, Branch, BranchCreate } from './types';
|
||||
import { BranchContact } from '../branch-contact/types';
|
||||
import axios from 'axios';
|
||||
import useFlowStore from '../flow';
|
||||
|
|
@ -120,6 +120,7 @@ const useBranchStore = defineStore('api-branch', () => {
|
|||
|
||||
async function create(
|
||||
branch: BranchCreate,
|
||||
bank?: BankBook[],
|
||||
flow?: {
|
||||
sessionId?: string;
|
||||
refTransactionId?: string;
|
||||
|
|
@ -134,13 +135,17 @@ const useBranchStore = defineStore('api-branch', () => {
|
|||
qrCodeImageUploadUrl: string;
|
||||
imageUploadUrl: string;
|
||||
}
|
||||
>('/branch', payload, {
|
||||
headers: {
|
||||
'X-Session-Id': flow?.sessionId,
|
||||
'X-Rtid': flow?.refTransactionId || flowStore.rtid,
|
||||
'X-Tid': flow?.transactionId,
|
||||
>(
|
||||
'/branch',
|
||||
{ ...payload, bank: bank },
|
||||
{
|
||||
headers: {
|
||||
'X-Session-Id': flow?.sessionId,
|
||||
'X-Rtid': flow?.refTransactionId || flowStore.rtid,
|
||||
'X-Tid': flow?.transactionId,
|
||||
},
|
||||
},
|
||||
});
|
||||
);
|
||||
|
||||
qrCodeImage &&
|
||||
(await axios
|
||||
|
|
@ -169,6 +174,7 @@ const useBranchStore = defineStore('api-branch', () => {
|
|||
data: Partial<BranchCreate & { status: 'ACTIVE' | 'INACTIVE' | 'CREATED' }>,
|
||||
qrCodeImage?: File | undefined,
|
||||
imageHq?: File | undefined,
|
||||
bank?: BankBook[],
|
||||
flow?: {
|
||||
sessionId?: string;
|
||||
refTransactionId?: string;
|
||||
|
|
@ -178,13 +184,17 @@ const useBranchStore = defineStore('api-branch', () => {
|
|||
const { ...payload } = data;
|
||||
const res = await api.put<
|
||||
Branch & { qrCodeImageUploadUrl: string; imageUploadUrl: string }
|
||||
>(`/branch/${id}`, payload, {
|
||||
headers: {
|
||||
'X-Session-Id': flow?.sessionId,
|
||||
'X-Rtid': flow?.refTransactionId || flowStore.rtid,
|
||||
'X-Tid': flow?.transactionId,
|
||||
>(
|
||||
`/branch/${id}`,
|
||||
{ ...payload, bank: bank },
|
||||
{
|
||||
headers: {
|
||||
'X-Session-Id': flow?.sessionId,
|
||||
'X-Rtid': flow?.refTransactionId || flowStore.rtid,
|
||||
'X-Tid': flow?.transactionId,
|
||||
},
|
||||
},
|
||||
});
|
||||
);
|
||||
|
||||
if (qrCodeImage) {
|
||||
await axios
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue