-
Notifications
You must be signed in to change notification settings - Fork 29
Admin panel #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: techspradha25
Are you sure you want to change the base?
Admin panel #125
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,7 @@ export const createEvent = asyncHandler(async (req, res) => { | |
| const posterLocalPath = req?.files?.poster[0]?.path; | ||
|
|
||
| if (!posterLocalPath) { | ||
| return res.status(400).json({ message: "poster is required" }); | ||
| return res.status(400).json({ success : false, message: "poster is required" }); | ||
| } | ||
|
|
||
| const cloudinaryPosterPath = await uploadOnCloudinary(posterLocalPath); | ||
|
|
@@ -83,16 +83,17 @@ export const updateEventById = async (req, res) => { | |
| } | ||
|
|
||
| const eventData = req.body; | ||
| console.log("New data : ", eventData); | ||
|
|
||
| // checking if event name alrady exist in databse (as it is unique) | ||
| if (eventData.name) { | ||
| const ifExisted = await Event.findOne({ name: eventData.name }); | ||
| if (ifExisted) { | ||
| return res.status(409).json({ | ||
| message: "Event name already exists try using differnt event name", | ||
| }); | ||
| } | ||
| } | ||
| // if (eventData.name) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this is removed? |
||
| // const ifExisted = await Event.findOne({ name: eventData.name }); | ||
| // if (ifExisted) { | ||
| // return res.status(409).json({ | ||
| // message: "Event name already exists try using differnt event name", | ||
| // }); | ||
| // } | ||
| // } | ||
|
|
||
| const updatedEvent = await Event.findByIdAndUpdate(eventId, eventData, { | ||
| new: true, | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make sure to remove the files from the temp folder once it's uploaded on the cloudinary |
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't commit these images |
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same for this file |
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't delete this file this is in the repo for future contributors reference