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

@ -21,9 +21,9 @@ const useCustomerStore = defineStore('api-customer', () => {
async function fetchListById(
customerId: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.get<Customer & { branch: CustomerBranch[] }>(
@ -63,9 +63,9 @@ const useCustomerStore = defineStore('api-customer', () => {
>(
opts?: Options,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
): Promise<Data | false> {
const params = new URLSearchParams();
@ -113,9 +113,9 @@ const useCustomerStore = defineStore('api-customer', () => {
>(
opts?: Options,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
): Promise<Data | false> {
const params = new URLSearchParams();
@ -146,9 +146,9 @@ const useCustomerStore = defineStore('api-customer', () => {
}
async function getStatsCustomer(flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
}) {
const res = await api.get<CustomerStats>('/customer/type-stats', {
headers: {
@ -165,9 +165,9 @@ const useCustomerStore = defineStore('api-customer', () => {
async function create(
data: CustomerCreate,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const { image, ...payload } = data;
@ -217,9 +217,9 @@ const useCustomerStore = defineStore('api-customer', () => {
id: string,
data: Partial<CustomerUpdate>,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const { image, ...payload } = data;
@ -268,9 +268,9 @@ const useCustomerStore = defineStore('api-customer', () => {
async function deleteById(
id: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.delete<Customer>(`/customer/${id}`, {
@ -290,9 +290,9 @@ const useCustomerStore = defineStore('api-customer', () => {
async function createBranch(
data: CustomerBranchCreate & { customerId: string },
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.post<
@ -317,9 +317,9 @@ const useCustomerStore = defineStore('api-customer', () => {
id: string,
data: Partial<CustomerBranchCreate & { customerId: string }>,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.put<
@ -341,9 +341,9 @@ const useCustomerStore = defineStore('api-customer', () => {
async function deleteBranchById(
id: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.delete<Customer>(`/customer-branch/${id}`, {
@ -364,9 +364,9 @@ const useCustomerStore = defineStore('api-customer', () => {
branchId: string,
payload: BranchAttachmentCreate,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const list: { name: string; file: File }[] = [];
@ -425,9 +425,9 @@ const useCustomerStore = defineStore('api-customer', () => {
async function fetchListBranchById(
branchId: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.get(`/customer-branch/${branchId}`, {