Feat/events backend#56
Conversation
RLee64
left a comment
There was a problem hiding this comment.
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.
| const eventSchema = new Schema({ | ||
| title: { type: String, required: true }, | ||
| description: { type: String, required: true }, | ||
| imageURL: { type: String, required: true }, |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
|
Oh, also fix the typescript stuff lol |
RLee64
left a comment
There was a problem hiding this comment.
Quick thing to address!!
|
|
||
| const router = express().Router(); | ||
|
|
||
| router.get("/", getAllEvents); |
There was a problem hiding this comment.
Oh wait hold on I completely forgot! Make sure the create/update/delete routes are protected using the admin guard!!!
No description provided.