From ced8f1e24cfc8f0f72e01b7c2952d4532ef52e27 Mon Sep 17 00:00:00 2001 From: Melissa Autumn Date: Wed, 17 Apr 2024 16:01:09 -0700 Subject: [PATCH] Add wip invite panel --- backend/src/appointment/routes/invite.py | 5 + frontend/src/router.js | 5 + frontend/src/views/InvitePanelView.vue | 165 +++++++++++++++++++++++ 3 files changed, 175 insertions(+) create mode 100644 frontend/src/views/InvitePanelView.vue diff --git a/backend/src/appointment/routes/invite.py b/backend/src/appointment/routes/invite.py index eae73447e..e2e285eaf 100644 --- a/backend/src/appointment/routes/invite.py +++ b/backend/src/appointment/routes/invite.py @@ -12,6 +12,11 @@ router = APIRouter() +@router.get('/', response_model=list[schemas.Invite]) +def get_all_invites(db: Session = Depends(get_db)): + return db.query(models.Invite).all() + + @router.post("/generate/{n}", response_model=list[schemas.Invite]) def generate_invite_codes(n: int, db: Session = Depends(get_db)): """endpoint to generate n invite codes""" diff --git a/frontend/src/router.js b/frontend/src/router.js index ae09b1a78..291e5904c 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -83,6 +83,11 @@ const routes = [ name: 'terms', component: () => import('@/views/LegalView'), }, + { + path: '/admin/invites', + name: 'admin-invite-panel', + component: () => import('@/views/InvitePanelView.vue'), + }, ]; // create router object to export diff --git a/frontend/src/views/InvitePanelView.vue b/frontend/src/views/InvitePanelView.vue new file mode 100644 index 000000000..80a32dbbd --- /dev/null +++ b/frontend/src/views/InvitePanelView.vue @@ -0,0 +1,165 @@ + + + + +