.subject.js 658 B

123456789101112131415161718192021222324252627282930313233343536
  1. module.exports = {
  2. create: {
  3. requestBody: ["code", "!name", "type", "need_teacher"],
  4. },
  5. destroy: {
  6. params: ["!id"],
  7. service: "delete",
  8. },
  9. update: {
  10. params: ["!id"],
  11. requestBody: ["code", "!name", "type", "need_teacher"],
  12. },
  13. show: {
  14. parameters: {
  15. params: ["!id"],
  16. },
  17. service: "fetch",
  18. },
  19. index: {
  20. parameters: {
  21. query: {
  22. code: "code",
  23. name: "name",
  24. type: "type",
  25. need_teacher: "need_teacher",
  26. },
  27. },
  28. service: "query",
  29. options: {
  30. query: ["skip", "limit"],
  31. sort: ["meta.createdAt"],
  32. desc: true,
  33. count: true,
  34. },
  35. },
  36. };