Advertisement
Guest User

LocationGroup.ts

a guest
Feb 15th, 2023
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. import { CollectionConfig } from "payload/types";
  2. import { isAdmin } from "../access/isAdmin";
  3.  
  4. export const LocationGroupCategories: CollectionConfig = {
  5. slug: "location-group-categories",
  6. admin: {
  7. useAsTitle: "title",
  8. group: "Category",
  9. },
  10. access: {
  11. // Only admins can create
  12. create: isAdmin,
  13. // Only admins or editors with site access can read
  14. read: () => true,
  15. // Only admins can update
  16. update: isAdmin,
  17. // Only admins can delete
  18. delete: isAdmin,
  19. },
  20. fields: [
  21. {
  22. name: "title",
  23. type: "text",
  24. required: true,
  25. },
  26. ],
  27. };
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement