From 3432c14e98f769b2f569f7ae93a0665202fb706a Mon Sep 17 00:00:00 2001 From: "Yeyang (Justin) Sun" Date: Fri, 8 Mar 2024 21:21:19 +1030 Subject: [PATCH 1/4] refactor: use `unique` for `clerkId` to avoid duplicate user in db (#113) --- src/app/api/member/route.ts | 7 ------- src/db/schema.ts | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/app/api/member/route.ts b/src/app/api/member/route.ts index a4c677fd..3ccf4e32 100644 --- a/src/app/api/member/route.ts +++ b/src/app/api/member/route.ts @@ -1,6 +1,5 @@ import { db } from '@/db'; import { memberTable } from '@/db/schema'; -import { checkUserExists } from '@/server/check-user-exists'; import { currentUser } from '@clerk/nextjs'; import { createInsertSchema } from 'drizzle-zod'; import { z } from 'zod'; @@ -22,12 +21,6 @@ export async function POST(request: Request) { return new Response(JSON.stringify(reqBody.error.format()), { status: 400 }); } - // Avoid duplicate users in database - const userExists = await checkUserExists(user.id); - if (userExists) { - return new Response(null, { status: 403 }); - } - await db.insert(memberTable).values({ clerkId: user.id, email: user.emailAddresses[0].emailAddress, diff --git a/src/db/schema.ts b/src/db/schema.ts index de395fa4..7836eb42 100644 --- a/src/db/schema.ts +++ b/src/db/schema.ts @@ -14,7 +14,7 @@ export const memberTable = sqliteTable('members', { .$defaultFn(() => nanoid()) .primaryKey(), - clerkId: text('clerk_id').notNull(), + clerkId: text('clerk_id').notNull().unique(), email: text('email').notNull(), firstName: text('first_name').notNull(), lastName: text('last_name').notNull(), From 59df12156ecfb50e7f16a0b5f999f4be0a276c63 Mon Sep 17 00:00:00 2001 From: "Yeyang (Justin) Sun" Date: Fri, 15 Mar 2024 01:09:25 +1030 Subject: [PATCH 2/4] chore: Update committee members (#119) * refactor(about): committee data type * chore(about): update committee members * chore(about): transfer all rep to general committee * chore(about): update committee --- src/app/about/page.tsx | 4 +- src/data/committee-members.ts | 94 +++++++++++++++++------------------ 2 files changed, 48 insertions(+), 50 deletions(-) diff --git a/src/app/about/page.tsx b/src/app/about/page.tsx index 7d62f619..9909d9e1 100644 --- a/src/app/about/page.tsx +++ b/src/app/about/page.tsx @@ -237,7 +237,7 @@ export default function AboutPage() { {COMMITTEE_MEMBERS.map((member, index) => (

{member.name}

{member.position}

diff --git a/src/data/committee-members.ts b/src/data/committee-members.ts index 1a910db2..43114218 100644 --- a/src/data/committee-members.ts +++ b/src/data/committee-members.ts @@ -1,125 +1,123 @@ type CommitteeMember = { name: string; position: string; - isExecCommittee: boolean; + exec?: boolean; }; // List of committee members with name, role and whether they are part of the // executive committee -export const COMMITTEE_MEMBERS = [ +export const COMMITTEE_MEMBERS: CommitteeMember[] = [ { name: 'David Maslov', position: 'President', - isExecCommittee: true, + exec: true, }, { name: 'Cubie', position: 'Vice-President', - isExecCommittee: true, + exec: true, }, { name: 'Christian', position: 'Treasurer', - isExecCommittee: true, + exec: true, }, { name: 'Ray Okamoto', position: 'Secretary', - isExecCommittee: true, + exec: true, }, { name: 'Milan', position: 'Partnerships & Sponsorships Manager', - isExecCommittee: true, + exec: true, }, { name: 'F. Umar', position: 'Partnerships & Sponsorships Officer', - isExecCommittee: false, }, { name: 'Pouya', position: 'Partnerships & Sponsorships Officer', - isExecCommittee: false, }, { name: 'Bowen Sun', position: 'Business Manager', - isExecCommittee: false, }, { name: 'Willard Gorman', position: 'Duck Lounge Liaison', - isExecCommittee: false, }, { name: 'Mischa Sarac', position: 'Equity Officer', - isExecCommittee: false, }, { - name: 'S. Bhatta', - position: 'Artificial Intelligence Representative', - isExecCommittee: false, + name: 'Maged Gayed', + position: 'First Year Representative', }, { - name: 'Will Johnston', - position: 'Cybersecurity Representative', - isExecCommittee: false, + name: 'Yuhan Wang', + position: 'Graphic Designer', }, { - name: 'Khanh', - position: 'Data Science Representative', - isExecCommittee: false, + name: 'M. Klaric', + position: 'Graphic Designer', }, { - name: 'Jonty Leslie', - position: 'Distributed Systems & Networking Representative', - isExecCommittee: false, + name: 'Darcy', + position: 'Social Media Officer', }, { - name: 'Joshua Goldsworthy Callaway', - position: 'Information Technology Representative', - isExecCommittee: false, + name: 'Yaman Ashqar', + position: 'Social Media Officer', }, { - name: 'Dino Macri', - position: 'Software Engineering Representative', - isExecCommittee: false, + name: 'Omar Badr', + position: 'Social Media Officer', }, { - name: 'Yuhan Wang', - position: 'Graphic Designer', - isExecCommittee: false, + name: 'Phoenix Pereira', + position: 'Open Source Officer', }, { - name: 'Darcy', - position: 'Social Media Officer', - isExecCommittee: false, + name: 'Yeyang (Justin) Sun', + position: 'Open Source Officer', }, { - name: 'M. Klaric', - position: 'Social Media Officer', - isExecCommittee: false, + name: 'S. Bhatta', + position: 'General Committee', }, { - name: 'Phoenix Pereira', - position: 'Open Source Officer', - isExecCommittee: false, + name: 'Will Johnston', + position: 'General Committee', }, { - name: 'Rishi Adhikari', - position: 'Open Source Officer', - isExecCommittee: false, + name: 'Khanh', + position: 'General Committee', + }, + { + name: 'Jonty Leslie', + position: 'General Committee', }, { name: 'Cuinn Kemp', position: 'General Committee', - isExecCommittee: false, }, { name: 'Timothy Choi', position: 'General Committee', - isExecCommittee: false, }, -] as const satisfies CommitteeMember[]; + { + name: 'Leo Li', + position: 'General Committee', + }, + { + name: 'Zachary Anderson', + position: 'General Committee', + }, + { + name: 'Mansi Patel', + position: 'General Committee', + }, +]; From 89f5c3effda2a763e7e4252d07727e36fdad0009 Mon Sep 17 00:00:00 2001 From: phoenixpereira Date: Tue, 19 Mar 2024 20:21:25 +1030 Subject: [PATCH 3/4] chore: update instagram link --- src/data/links.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/links.ts b/src/data/links.ts index 1f287137..8b45068c 100644 --- a/src/data/links.ts +++ b/src/data/links.ts @@ -10,7 +10,7 @@ import { export const LINKS = [ { name: 'Email', link: 'mailto:contact@csclub.org.au', icon: FaEnvelope }, { name: 'GitHub', link: 'https://github.com/compsci-adl', icon: FaGithub }, - { name: 'Instagram', link: 'https://www.instagram.com/compsci.adl/', icon: FaInstagram }, + { name: 'Instagram', link: 'https://www.instagram.com/csclub.adl/', icon: FaInstagram }, { name: 'Facebook', link: 'https://www.facebook.com/compsci.adl/', icon: FaFacebook }, { name: 'Discord', link: 'https://discord.gg/UjvVxHA', icon: FaDiscord }, { name: 'LinkedIn', link: 'https://www.linkedin.com/company/compsci-adl/', icon: FaLinkedin }, From 958453458ea59e545b9320f554829da8a0be353c Mon Sep 17 00:00:00 2001 From: phoenixpereira Date: Tue, 19 Mar 2024 20:21:53 +1030 Subject: [PATCH 4/4] chore: comment out latex workshop and quiz night --- src/data/events.ts | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/data/events.ts b/src/data/events.ts index f7666919..9ad2b877 100644 --- a/src/data/events.ts +++ b/src/data/events.ts @@ -41,14 +41,14 @@ export const EVENTS: Event[] = [ // 'Unsure of what jobs are available in the tech industry? Or looking to find out more about where your expertise could take you? If so, come along and gain insights into what a career in the industry might look like.', // image: 'insight-into-industry.jpg', // }, - { - title: 'Quiz Night', - date: { month: 'MAR', day: 8 }, - time: '6:00pm - 9:00pm', - location: 'Ingkarni Wardli 218', - details: 'Join us for a night of quizzical encounters! Free food and prizes to come!', - image: 'quiz-night.jpg', - }, + // { + // title: 'Quiz Night', + // date: { month: 'MAR', day: 8 }, + // time: '6:00pm - 9:00pm', + // location: 'Ingkarni Wardli 218', + // details: 'Join us for a night of quizzical encounters! Free food and prizes to come!', + // image: 'quiz-night.jpg', + // }, { title: 'Industry Night', date: { month: 'APR', day: 2 }, @@ -57,15 +57,15 @@ export const EVENTS: Event[] = [ details: 'Connect with top companies and explore job opportunities in the tech industry!', image: 'industry-night.jpg', }, - { - title: 'LaTeX Workshop', - date: { month: 'APR', day: 4 }, - time: '5:00pm - 7:00pm', - location: 'Ingkarni Wardli 218', - details: - 'Do you want to create pretty documents? Is Word destroying your assignments when you move images around? Look no further than LaTeX, the academic typesetting tool created by the great Donald Knuth, and the solution to all your maths assignments.', - image: 'latex-workshop.jpg', - }, + // { + // title: 'LaTeX Workshop', + // date: { month: 'APR', day: 4 }, + // time: '5:00pm - 7:00pm', + // location: 'Ingkarni Wardli 218', + // details: + // 'Do you want to create pretty documents? Is Word destroying your assignments when you move images around? Look no further than LaTeX, the academic typesetting tool created by the great Donald Knuth, and the solution to all your maths assignments.', + // image: 'latex-workshop.jpg', + // }, ]; export const CAROUSEL_IMAGES: Image[] = [