|
@@ -3,7 +3,7 @@ import { defineStore } from 'pinia';
|
|
|
import { AxiosWrapper } from '@/util/axios-wrapper';
|
|
|
import _ from 'lodash';
|
|
|
|
|
|
-import type { IQueryType, IQueryResult } from '@/util/types.util';
|
|
|
+import type { IQueryType, IQueryResult, IQueryParams } from '@/util/types.util';
|
|
|
const axios = new AxiosWrapper();
|
|
|
const projectApi = {
|
|
|
url: '/api/util/dbInit/project',
|
|
@@ -18,7 +18,7 @@ export const useCounterStore = defineStore('counter', () => {
|
|
|
count.value++;
|
|
|
}
|
|
|
|
|
|
- const projectQuery = async ({ skip = 0, limit = undefined, ...info } = {}): Promise<IQueryResult> => {
|
|
|
+ const projectQuery = async ({ skip = 0, limit = undefined, ...info }: IQueryParams = {}): Promise<IQueryResult> => {
|
|
|
let cond: IQueryType = {};
|
|
|
if (skip) cond.skip = skip;
|
|
|
if (limit) cond.limit = limit;
|
|
@@ -26,8 +26,8 @@ export const useCounterStore = defineStore('counter', () => {
|
|
|
const res = await axios.$get(`${projectApi.url}`, cond);
|
|
|
return res;
|
|
|
};
|
|
|
- const projectFetch = async (payload: any): Promise<IQueryResult> => {
|
|
|
- const res = await axios.$get(`${projectApi.url}/${payload}`);
|
|
|
+ const projectFetch = async (id: string): Promise<IQueryResult> => {
|
|
|
+ const res = await axios.$get(`${projectApi.url}/${id}`);
|
|
|
return res;
|
|
|
};
|
|
|
const projectCreate = async (payload: any): Promise<IQueryResult> => {
|
|
@@ -43,7 +43,7 @@ export const useCounterStore = defineStore('counter', () => {
|
|
|
const res = await axios.$delete(`${projectApi.url}/${payload}`);
|
|
|
return res;
|
|
|
};
|
|
|
- const tabelQuery = async ({ skip = 0, limit = undefined, ...info } = {}): Promise<IQueryResult> => {
|
|
|
+ const tabelQuery = async ({ skip = 0, limit = undefined, ...info }: IQueryParams = {}): Promise<IQueryResult> => {
|
|
|
let cond: IQueryType = {};
|
|
|
if (skip) cond.skip = skip;
|
|
|
if (limit) cond.limit = limit;
|