Skip to content

Commit

Permalink
Merge pull request #35 from kentibs/feat/events-api
Browse files Browse the repository at this point in the history
fix: prevent empty files array images
  • Loading branch information
Tibz-Dankan authored Jan 11, 2024
2 parents 56c88ba + 5809b98 commit 791f9d1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/controllers/eventsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export const postEvent = asyncHandler(
if (files == undefined) {
return next(new AppError("Please Provide at least one event photo", 400));
}
if (!files[0]) {
return next(new AppError("Please Provide at least one event photo", 400));
}

const newEvent = await Event.create({
data: {
Expand Down

0 comments on commit 791f9d1

Please sign in to comment.