static async getAllFactory<T>({
apiUrl,
options,
adapter,
}: {
apiUrl: string
options?: any
adapter: (data: any, options?: any) => ResultList<T>
}): Promise<ResultList<T>> {
const url = ApiQuery.buildQueryString(apiUrl, options)
let response: unknown
await useApiFetch(url)
.catch((error) => {
throw error
})
.then((res) => {
response = res
})
return adapter(response, options)
}
static async getAllFactory<T>({
apiUrl,
options,
adapter,
}: {
apiUrl: string
options?: any
adapter: (data: any, options?: any) => ResultList<T>
}): Promise<ResultList<T>> {
const url = ApiQuery.buildQueryString(apiUrl, options)
let response: unknown
await useApiFetch(url)
.catch((error) => {
throw error
})
.then((res) => {
response = res
})
return adapter(response, options)
}