Skip to content

Feat/events backend#56

Open
varsh42 wants to merge 3 commits into
mainfrom
feat/events-backend
Open

Feat/events backend#56
varsh42 wants to merge 3 commits into
mainfrom
feat/events-backend

Conversation

@varsh42
Copy link
Copy Markdown
Contributor

@varsh42 varsh42 commented May 24, 2026

No description provided.

Copy link
Copy Markdown
Collaborator

@RLee64 RLee64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm! Just a few comments to look through and you're good to merge in. For future reference, any 'nit' from me is an optional change that's not essential to address.

Comment thread server/src/model/event.ts
const eventSchema = new Schema({
title: { type: String, required: true },
description: { type: String, required: true },
imageURL: { type: String, required: true },
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should be imageUrl instead of imageURL (I've also just realized that the Exec stuff also uses imageURL, but the correct convention should be imageUrl)


export const addEvent: RequestHandler = async (req, res, next) => {
try {
const newEvent = new Event(req.body);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We expect frontend to just pass in a date (with a time probably set to 12am GMT). To both synchronise it with NZ time and to keep the event under 'upcoming' until the next day, could we set the time part to 11:59pm NZST?

@RLee64
Copy link
Copy Markdown
Collaborator

RLee64 commented May 25, 2026

Oh, also fix the typescript stuff lol

Copy link
Copy Markdown
Collaborator

@RLee64 RLee64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick thing to address!!


const router = express().Router();

router.get("/", getAllEvents);
Copy link
Copy Markdown
Collaborator

@RLee64 RLee64 May 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait hold on I completely forgot! Make sure the create/update/delete routes are protected using the admin guard!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants