diff --git a/src/app/manage/[clubId]/edit/officers/page.tsx b/src/app/manage/[clubId]/edit/officers/page.tsx index 6b7817a..984253d 100644 --- a/src/app/manage/[clubId]/edit/officers/page.tsx +++ b/src/app/manage/[clubId]/edit/officers/page.tsx @@ -21,7 +21,7 @@ export default async function Page({ name: officer.userMetadata.firstName + ' ' + officer.userMetadata.lastName, locked: officer.memberType == 'President' || role == 'Officer', position: officer.memberType as 'President' | 'Officer', - title: "", // TODO: link from officers table + title: '', // TODO: link from officers table })); return ( diff --git a/src/server/api/routers/clubEdit.ts b/src/server/api/routers/clubEdit.ts index 67b21e4..30ca549 100644 --- a/src/server/api/routers/clubEdit.ts +++ b/src/server/api/routers/clubEdit.ts @@ -165,7 +165,7 @@ export const clubEditRouter = createTRPCRouter({ ) .onConflictDoUpdate({ target: [userMetadataToClubs.userId, userMetadataToClubs.clubId], - set: { memberType: 'Officer' as const}, + set: { memberType: 'Officer' as const }, where: eq(userMetadataToClubs.memberType, 'Member'), }); }), diff --git a/src/server/db/schema/officers.ts b/src/server/db/schema/officers.ts index dc9ad60..413ded8 100644 --- a/src/server/db/schema/officers.ts +++ b/src/server/db/schema/officers.ts @@ -3,22 +3,22 @@ import { pgTable, text, boolean, primaryKey } from 'drizzle-orm/pg-core'; import { club } from './club'; export const officers = pgTable( - 'officers', - { - id: text('id').notNull(), - clubId: text('club_id') - .notNull() - .references(() => club.id), - name: text('name').notNull(), - position: text('position').notNull(), - image: text('image').default('/nebula-logo.png').notNull(), - isPresident: boolean('is_president').default(false).notNull(), - }, - (table) => ({ - pk: primaryKey(table.clubId, table.id), - }) + 'officers', + { + id: text('id').notNull(), + clubId: text('club_id') + .notNull() + .references(() => club.id), + name: text('name').notNull(), + position: text('position').notNull(), + image: text('image').default('/nebula-logo.png').notNull(), + isPresident: boolean('is_president').default(false).notNull(), + }, + (table) => ({ + pk: primaryKey(table.clubId, table.id), + }), ); export const officersToClubs = relations(officers, ({ one }) => ({ - club: one(club, { fields: [officers.clubId], references: [club.id] }), -})); \ No newline at end of file + club: one(club, { fields: [officers.clubId], references: [club.id] }), +}));