From 32d01717564e19ea581d6f7ddda2109656b1ed3e Mon Sep 17 00:00:00 2001 From: Casper <148681165+casperUoS@users.noreply.github.com> Date: Tue, 3 Sep 2024 19:39:46 +0100 Subject: [PATCH] added sorting to soceity --- .../_components/CollectionArchive/index.tsx | 2 +- src/payload/collections/Committee.ts | 1 - src/payload/payload-types.ts | 28 ++++++++++++++++++- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/app/_components/CollectionArchive/index.tsx b/src/app/_components/CollectionArchive/index.tsx index 42b02f8..b146b8c 100644 --- a/src/app/_components/CollectionArchive/index.tsx +++ b/src/app/_components/CollectionArchive/index.tsx @@ -118,7 +118,7 @@ export const CollectionArchive: React.FC = props => { depth: 1, limit, page, - sort: 'level', + sort: relationTo === 'committee' ? 'position' : 'level', where: { ...(categories ? { diff --git a/src/payload/collections/Committee.ts b/src/payload/collections/Committee.ts index 9b4540f..149db16 100644 --- a/src/payload/collections/Committee.ts +++ b/src/payload/collections/Committee.ts @@ -63,7 +63,6 @@ const Committee: CollectionConfig = { 'Webmaster', 'Web Officer', 'Welfare Officer', - "Women's Representative", ], }, { diff --git a/src/payload/payload-types.ts b/src/payload/payload-types.ts index af4d5fb..ffb7023 100644 --- a/src/payload/payload-types.ts +++ b/src/payload/payload-types.ts @@ -1189,7 +1189,33 @@ export interface Committee { id: string; firstName: string | null; lastName: string | null; - position?: string | null; + position?: ( + 'President'| + 'Vice President Engagement'| + 'Vice President Operations'| + 'Secretary'| + 'Treasurer'| + 'Events Officer'| + 'Welfare Officer'| + 'Social Secretary'| + 'Web Officer'| + 'Sports Officer'| + 'Marketing Officer'| + 'Hackathon Officer'| + 'Industry Officer'| + 'International Representative'| + 'Gamesmaster'| + 'Games Officer'| + 'Masters Rep'| + 'Postgraduate Representative'| + 'Publicity Officer'| + 'Sports Representative'| + 'Staff Representative'| + 'Academic Secretary'| + 'Vice President'| + 'Webmaster'| + 'Unknown Role' + ) | null; bio?: | { [k: string]: unknown;