|
- import { serverFetchJson } from "@/app/utils/fetchUtil";
- import { BASE_API_URL } from "@/config/api";
- import { cache } from "react";
- import "server-only";
-
- export interface QcCategoryResult {
- id: number;
- code: string;
- name: string;
- }
-
- export const preloadQcCategory = () => {
- fetchQcCategories();
- };
-
- export const fetchQcCategories = cache(async () => {
- return serverFetchJson<QcCategoryResult[]>(`${BASE_API_URL}/qcCategories`, {
- next: { tags: ["qcCategories"] },
- });
- });
|