FPSMS-frontend
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

6 месяцев назад
5 месяцев назад
6 месяцев назад
6 месяцев назад
5 месяцев назад
5 месяцев назад
5 месяцев назад
5 месяцев назад
5 месяцев назад
5 месяцев назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. "use server";
  2. // import { serverFetchJson, serverFetchWithNoContent } from "@/app/utils/fetchUtil";
  3. // import { BASE_API_URL } from "@/config/api";
  4. import {
  5. serverFetchJson,
  6. serverFetchWithNoContent,
  7. } from "../../utils/fetchUtil";
  8. import { BASE_API_URL } from "../../../config/api";
  9. import { MailSetting, MailTemplate } from ".";
  10. export interface MailSave {
  11. settings: MailSetting[];
  12. templates: MailTemplate[];
  13. // template: MailTemplate;
  14. }
  15. export const saveMail = async (data: MailSave) => {
  16. return serverFetchJson<MailSetting[]>(`${BASE_API_URL}/mails/save`, {
  17. method: "POST",
  18. body: JSON.stringify(data),
  19. headers: { "Content-Type": "application/json" },
  20. });
  21. };
  22. export const testSendMail = async () => {
  23. return serverFetchWithNoContent(`${BASE_API_URL}/mails/test-send`, {
  24. method: "GET",
  25. // body: JSON.stringify(data),
  26. headers: { "Content-Type": "application/json" },
  27. });
  28. };
  29. export const testEveryone = async () => {
  30. return serverFetchWithNoContent(`${BASE_API_URL}/mails/testEveryone`, {
  31. method: "GET",
  32. // body: JSON.stringify(data),
  33. headers: { "Content-Type": "application/json" },
  34. });
  35. };
  36. export const test7th = async () => {
  37. return serverFetchWithNoContent(`${BASE_API_URL}/mails/test7th`, {
  38. method: "GET",
  39. // body: JSON.stringify(data),
  40. headers: { "Content-Type": "application/json" },
  41. });
  42. };
  43. export const test15th = async () => {
  44. return serverFetchWithNoContent(`${BASE_API_URL}/mails/test15th`, {
  45. method: "GET",
  46. // body: JSON.stringify(data),
  47. headers: { "Content-Type": "application/json" },
  48. });
  49. };