FPSMS-frontend
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

21 wiersze
489 B

  1. import { serverFetchJson } from "@/app/utils/fetchUtil";
  2. import { BASE_API_URL } from "@/config/api";
  3. import { cache } from "react";
  4. import "server-only";
  5. export interface QcCategoryResult {
  6. id: number;
  7. code: string;
  8. name: string;
  9. }
  10. export const preloadQcCategory = () => {
  11. fetchQcCategories();
  12. };
  13. export const fetchQcCategories = cache(async () => {
  14. return serverFetchJson<QcCategoryResult[]>(`${BASE_API_URL}/qcCategories`, {
  15. next: { tags: ["qcCategories"] },
  16. });
  17. });