Skip to content

Commit f785ade

Browse files
JoshXL23Joshua Gonsalvescybercoder-najDropheart
authored
feat(server): qr routes (#187)
Co-authored-by: Joshua Gonsalves <[email protected]> Co-authored-by: Nishant Aanjaney Jalan <[email protected]> Co-authored-by: jay <[email protected]>
1 parent e3dfd6d commit f785ade

File tree

9 files changed

+1167
-16
lines changed

9 files changed

+1167
-16
lines changed

docs/directory-structure/server/routes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,9 @@ POST /acceptInvite --> {teamId: string} removes all invites of the hacker and ad
6262
POST /removeInvite --> {teamId: string} removes that entry from team_invites table. "hacker"
6363
POST /removeUser/:userId --> Leader can remove a user from a team. "hacker"
6464
POST /removeUser --> authenticated hacker can remove themselves from the team. "hacker"
65+
66+
## QR (/qr)
67+
68+
POST / --> creates a entry in the db linking a user id to a qr code uuid "hacker"
69+
GET /:uuid --> gets the profile of a user from a given uuid "volunteer, admin"
70+
DELETE / --> deletes an entry from the db by uuid "god"

schemas/0002_qr.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CREATE TABLE "qr" (
2+
"user_id" text PRIMARY KEY NOT NULL,
3+
"uuid" text NOT NULL,
4+
CONSTRAINT "qr_uuid_unique" UNIQUE("uuid")
5+
);
6+
--> statement-breakpoint
7+
ALTER TABLE "qr" ADD CONSTRAINT "qr_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;

0 commit comments

Comments
 (0)