Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 

39 righe
957 B

  1. "use server";
  2. import { serverFetchJson } from "@/app/utils/fetchUtil";
  3. import { BASE_API_URL } from "@/config/api";
  4. export interface CreateCustomInputs {
  5. // Project details
  6. projectCode: string;
  7. projectName: string;
  8. // Miscellaneous
  9. expectedProjectFee: string;
  10. }
  11. export interface CreateStaffInputs {
  12. name: string;
  13. currentPositionId: number;
  14. joinPositionId: number;
  15. companyId: number;
  16. gradeId: number;
  17. teamId: number;
  18. salaryEffId: number;
  19. email: string;
  20. phone1: string;
  21. phone2: string;
  22. emergContactName: string;
  23. emergContactPhone: string;
  24. employType: string;
  25. departDate: string;
  26. departReason: string;
  27. remark: string;
  28. }
  29. export const saveStaff = async (data: CreateStaffInputs) => {
  30. return serverFetchJson(`${BASE_API_URL}/staffs/new`, {
  31. method: "POST",
  32. body: JSON.stringify(data),
  33. headers: { "Content-Type": "application/json" },
  34. });
  35. };