import { useQuery } from "@tanstack/vue-query";
import { computed, Ref } from "vue";
export const useArticleQuery = (articleUuid?: Ref<string | undefined>) => {
const enabled = computed(() => !!articleUuid?.value?.length);
return useQuery({
queryKey: ["api-article", articleUuid], // "The following dependencies are missing in your queryKey: articleUuid?.value" eslint@tanstack/query/exhaustive-deps
queryFn: () => Promise.resolve(`/api/articles/${articleUuid?.value}`),
enabled,
});
};
import { useQuery } from "@tanstack/vue-query";
import { computed, Ref } from "vue";
export const useArticleQuery = (articleUuid?: Ref<string | undefined>) => {
const enabled = computed(() => !!articleUuid?.value?.length);
return useQuery({
queryKey: ["api-article", articleUuid], // "The following dependencies are missing in your queryKey: articleUuid?.value" eslint@tanstack/query/exhaustive-deps
queryFn: () => Promise.resolve(`/api/articles/${articleUuid?.value}`),
enabled,
});
};