fix: type

This commit is contained in:
Methapon2001 2024-04-10 17:42:04 +07:00
parent 4d57c3d056
commit fd922592d9

View file

@ -10,9 +10,9 @@ import {
UserCreate,
} from './types';
import axios from 'axios';
import { Branch } from '../branch/types';
const useUserStore = defineStore('api-user', () => {
const userStats = ref()
const data = ref<Pagination<User[]>>();
async function fetchAttachment(
@ -282,7 +282,7 @@ const useUserStore = defineStore('api-user', () => {
transactionId: string;
},
) {
const res = await api.get(`/user/${userId}/branch`, {
const res = await api.get<Pagination<Branch[]>>(`/user/${userId}/branch`, {
headers: {
'X-Session-Id': flow?.sessionId,
'X-Rtid': flow?.refTransactionId,
@ -347,19 +347,18 @@ const useUserStore = defineStore('api-user', () => {
return res.data || true;
}
async function typeStats(
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
},) {
async function typeStats(flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
}) {
const res = await api.get(`/user/type-stats`, {
headers: {
'X-Session-Id': flow?.sessionId,
'X-Rtid': flow?.refTransactionId,
'X-Tid': flow?.transactionId,
},
})
});
if (!res) return false;
if (res.status === 200) return res.data;