Skip to content

Commit

Permalink
Fix TS typing
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard authored and renovate[bot] committed Feb 18, 2025
1 parent 2e42216 commit f61b853
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions frontend/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: MIT

import { useUserStore } from "@/stores/user";
import type { QueryFunctionContext } from "@tanstack/query-core";
import type { QueryKey } from "@tanstack/query-core";
import type { VueQueryPluginOptions } from "@tanstack/vue-query";
import axios, { type AxiosRequestConfig } from "axios";
import pinia from "../stores";
Expand Down Expand Up @@ -53,15 +53,11 @@ export async function getApiClient() {
});
}

interface QueryFunctionContextOrDirect
extends Omit<QueryFunctionContext, "signal" | "meta"> {
signal?: QueryFunctionContext["signal"];
meta?: QueryFunctionContext["meta"];
interface ApiGetArgs {
queryKey: QueryKey;
signal?: AxiosRequestConfig["signal"];
}
export const apiGet = async <Data>({
queryKey,
signal,
}: QueryFunctionContextOrDirect) => {
export const apiGet = async <Data>({ queryKey, signal }: ApiGetArgs) => {
const axiosConfig = await getAxiosConfig();
const url = queryKey[0] as string;
axiosConfig["params"] = queryKey[1];
Expand Down

0 comments on commit f61b853

Please sign in to comment.