FPSMS-frontend
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

63 regels
1.7 KiB

  1. "use server";
  2. import { serverFetchWithNoContent } from '@/app/utils/fetchUtil';
  3. import { BASE_API_URL } from "@/config/api";
  4. export interface M18ImportPoForm {
  5. modifiedDateFrom: string,
  6. modifiedDateTo: string,
  7. }
  8. export interface M18ImportDoForm {
  9. modifiedDateFrom: string,
  10. modifiedDateTo: string,
  11. }
  12. export interface M18ImportPqForm {
  13. modifiedDateFrom: string,
  14. modifiedDateTo: string,
  15. }
  16. export interface M18ImportMasterDataForm {
  17. modifiedDateFrom: string,
  18. modifiedDateTo: string,
  19. }
  20. export interface M18ImportTestingForm {
  21. po: M18ImportPoForm,
  22. do: M18ImportDoForm,
  23. pq: M18ImportPqForm,
  24. masterData: M18ImportMasterDataForm,
  25. }
  26. export const testM18ImportPo = async (data: M18ImportPoForm) => {
  27. return serverFetchWithNoContent(`${BASE_API_URL}/m18/po`, {
  28. method: "POST",
  29. body: JSON.stringify(data),
  30. headers: { "Content-Type": "application/json" },
  31. })
  32. }
  33. export const testM18ImportDo = async (data: M18ImportDoForm) => {
  34. return serverFetchWithNoContent(`${BASE_API_URL}/m18/do`, {
  35. method: "POST",
  36. body: JSON.stringify(data),
  37. headers: { "Content-Type": "application/json" },
  38. })
  39. }
  40. export const testM18ImportPq = async (data: M18ImportPqForm) => {
  41. return serverFetchWithNoContent(`${BASE_API_URL}/m18/pq`, {
  42. method: "POST",
  43. body: JSON.stringify(data),
  44. headers: { "Content-Type": "application/json" },
  45. })
  46. }
  47. export const testM18ImportMasterData = async (data: M18ImportMasterDataForm) => {
  48. return serverFetchWithNoContent(`${BASE_API_URL}/m18/master-data`, {
  49. method: "POST",
  50. body: JSON.stringify(data),
  51. headers: { "Content-Type": "application/json" },
  52. })
  53. }