Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

36 Zeilen
1.0 KiB

  1. "use server";
  2. import { serverFetchJson } from "@/app/utils/fetchUtil";
  3. import { BASE_API_URL } from "@/config/api";
  4. import { Dayjs } from "dayjs";
  5. import { cache } from "react";
  6. export interface ClientSubsidiaryProjectResult {
  7. color: string;
  8. projectId: number;
  9. projectCode: string;
  10. projectName: string;
  11. team: string;
  12. teamLead: string;
  13. expectedStage: string;
  14. budgetedManhour: number;
  15. spentManhour: number;
  16. remainedManhour: number;
  17. manhourConsumptionPercentage: number;
  18. comingPaymentMilestone: string;
  19. }
  20. export const fetchAllClientSubsidiaryProjects = cache(async (customerId: number, subsidiaryId?: number) => {
  21. if (subsidiaryId === 0){
  22. return serverFetchJson<ClientSubsidiaryProjectResult[]>(
  23. `${BASE_API_URL}/dashboard/searchCustomerSubsidiaryProject?customerId=${customerId}`
  24. );
  25. } else {
  26. return serverFetchJson<ClientSubsidiaryProjectResult[]>(
  27. `${BASE_API_URL}/dashboard/searchCustomerSubsidiaryProject?customerId=${customerId}&subsidiaryId=${subsidiaryId}`
  28. );
  29. }
  30. });