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

@ -29,9 +29,9 @@ const useBranchContactStore = defineStore('api-branch-contact', () => {
pageSize?: number;
},
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const params = new URLSearchParams();
@ -65,9 +65,9 @@ const useBranchContactStore = defineStore('api-branch-contact', () => {
branchId: string,
data: BranchContactCreate,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.post<
@ -91,9 +91,9 @@ const useBranchContactStore = defineStore('api-branch-contact', () => {
data: Partial<BranchContactCreate>,
qrCodeImage?: File,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const { ...payload } = data;
@ -128,9 +128,9 @@ const useBranchContactStore = defineStore('api-branch-contact', () => {
branchId: string,
contactId: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.delete<

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];

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}`, {

View file

@ -26,9 +26,9 @@ const useEmployeeStore = defineStore('api-employee', () => {
status?: 'CREATED' | 'ACTIVE' | 'INACTIVE';
},
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const params = new URLSearchParams();
@ -64,9 +64,9 @@ const useEmployeeStore = defineStore('api-employee', () => {
async function create(
data: EmployeeCreate,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const { image, ...payload } = data;
@ -97,9 +97,9 @@ const useEmployeeStore = defineStore('api-employee', () => {
id: string,
data: Partial<EmployeeCreate>,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const { image, ...payload } = data;
@ -129,9 +129,9 @@ const useEmployeeStore = defineStore('api-employee', () => {
async function deleteById(
id: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.delete<Employee>(`/employee/${id}`, {
@ -151,9 +151,9 @@ const useEmployeeStore = defineStore('api-employee', () => {
async function fetchCheckup(
id: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.get<EmployeeCheckup[]>(`/employee/${id}/checkup`, {
@ -171,9 +171,9 @@ const useEmployeeStore = defineStore('api-employee', () => {
async function fetchWork(
id: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.get<EmployeeWork[]>(`/employee/${id}/work`, {
@ -191,9 +191,9 @@ const useEmployeeStore = defineStore('api-employee', () => {
async function fetchOther(
id: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.get<EmployeeOther>(`/employee/${id}/other-info`, {
@ -211,9 +211,9 @@ const useEmployeeStore = defineStore('api-employee', () => {
async function getStatsEmployee(
customerBranchId?: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.get(
@ -234,9 +234,9 @@ const useEmployeeStore = defineStore('api-employee', () => {
async function getStatsEmployeeGender(
customerBranchId?: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.get(

View file

@ -58,9 +58,9 @@ const useProductServiceStore = defineStore('api-product-service', () => {
status?: 'CREATED' | 'ACTIVE' | 'INACTIVE';
},
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const params = new URLSearchParams();
@ -172,9 +172,9 @@ const useProductServiceStore = defineStore('api-product-service', () => {
async function fetchListProductService(
opts?: { query?: string; status?: 'CREATED' | 'ACTIVE' | 'INACTIVE' },
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const params = new URLSearchParams();
@ -282,9 +282,9 @@ const useProductServiceStore = defineStore('api-product-service', () => {
status?: string;
},
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const params = new URLSearchParams();
@ -410,9 +410,9 @@ const useProductServiceStore = defineStore('api-product-service', () => {
status?: string;
},
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const params = new URLSearchParams();
@ -473,9 +473,9 @@ const useProductServiceStore = defineStore('api-product-service', () => {
serviceId: string,
opts?: { query?: string; page?: number; pageSize?: number },
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const params = new URLSearchParams();

View file

@ -137,9 +137,9 @@ const useUserStore = defineStore('api-user', () => {
async function fetchAttachment(
userId: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.get<UserAttachment[]>(`/user/${userId}/attachment`, {
@ -160,9 +160,9 @@ const useUserStore = defineStore('api-user', () => {
userId: string,
payload: UserAttachmentCreate,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const list: { name: string; file: File }[] = [];
@ -222,9 +222,9 @@ const useUserStore = defineStore('api-user', () => {
userId: string,
payload: UserAttachmentDelete,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
await api.delete(`/user/${userId}/attachment`, {
@ -247,9 +247,9 @@ const useUserStore = defineStore('api-user', () => {
userType?: string;
},
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const params = new URLSearchParams();
@ -286,9 +286,9 @@ const useUserStore = defineStore('api-user', () => {
async function fetchById(
id: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.get<User>(`/user/${id}`, {
@ -309,9 +309,9 @@ const useUserStore = defineStore('api-user', () => {
async function create(
data: UserCreate,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const { profileImage, ...payload } = data;
@ -344,9 +344,9 @@ const useUserStore = defineStore('api-user', () => {
id: string,
data: Partial<UserCreate & { status?: 'ACTIVE' | 'INACTIVE' }>,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const { profileImage, ...payload } = data;
@ -378,9 +378,9 @@ const useUserStore = defineStore('api-user', () => {
async function deleteById(
id: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.delete<User>(`/user/${id}`, {
@ -400,9 +400,9 @@ const useUserStore = defineStore('api-user', () => {
async function getBranch(
userId: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.get<Pagination<Branch[]>>(`/user/${userId}/branch`, {
@ -423,9 +423,9 @@ const useUserStore = defineStore('api-user', () => {
userId: string,
branchId: string | string[],
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.post(
@ -450,9 +450,9 @@ const useUserStore = defineStore('api-user', () => {
userId: string,
branchId: string | string[],
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.delete(`/user/${userId}/branch`, {
@ -471,9 +471,9 @@ const useUserStore = defineStore('api-user', () => {
}
async function typeStats(flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
}) {
const res = await api.get('/user/type-stats', {
headers: {