"use server"; import { serverFetchJson } from "@/app/utils/fetchUtil"; import { BASE_API_URL } from "@/config/api"; export interface CreateCustomInputs { // Project details projectCode: string; projectName: string; // Miscellaneous expectedProjectFee: string; } export interface CreateStaffInputs { name: string; currentPositionId: number; joinPositionId: number; companyId: number; gradeId: number; teamId: number; salaryEffId: number; email: string; phone1: string; phone2: string; emergContactName: string; emergContactPhone: string; employType: string; departDate: string; departReason: string; remark: string; } export const saveStaff = async (data: CreateStaffInputs) => { return serverFetchJson(`${BASE_API_URL}/staffs/new`, { method: "POST", body: JSON.stringify(data), headers: { "Content-Type": "application/json" }, }); };