fix: type

This commit is contained in:
Methapon2001 2024-06-25 15:46:02 +07:00
parent 771b3e8ab6
commit e303464d7c
6 changed files with 159 additions and 159 deletions

View file

@ -37,9 +37,9 @@ const useBranchStore = defineStore('api-branch', () => {
>(
opts?: Options,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
): Promise<Data | false> {
const params = new URLSearchParams();
@ -86,9 +86,9 @@ const useBranchStore = defineStore('api-branch', () => {
id: string,
opts?: Options,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
): Promise<Data | false> {
const params = new URLSearchParams();
@ -119,9 +119,9 @@ const useBranchStore = defineStore('api-branch', () => {
async function create(
branch: BranchCreate,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const { qrCodeImage, imageUrl, ...payload } = branch;
@ -168,9 +168,9 @@ const useBranchStore = defineStore('api-branch', () => {
qrCodeImage?: File | undefined,
imageHq?: File | undefined,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const { ...payload } = data;
@ -210,9 +210,9 @@ const useBranchStore = defineStore('api-branch', () => {
async function deleteById(
id: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.delete<Branch>(`/branch/${id}`, {
@ -232,9 +232,9 @@ const useBranchStore = defineStore('api-branch', () => {
async function getUser(
branchId: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.get(`/branch/${branchId}/user`, {
@ -255,9 +255,9 @@ const useBranchStore = defineStore('api-branch', () => {
branchId: string,
userId: string | string[],
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.post(
@ -282,9 +282,9 @@ const useBranchStore = defineStore('api-branch', () => {
branchId: string,
userId: string | string[],
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.delete(`/branch/${branchId}/user`, {
@ -303,9 +303,9 @@ const useBranchStore = defineStore('api-branch', () => {
}
async function stats(flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
}) {
const res = await api.get<{
hq: number;
@ -327,9 +327,9 @@ const useBranchStore = defineStore('api-branch', () => {
async function userStats(
userType: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.get(
@ -353,9 +353,9 @@ const useBranchStore = defineStore('api-branch', () => {
branchId: BranchId,
force = false,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
if (!force && contact[branchId]) return contact[branchId];