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

@ -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: {