Skip to content

Commit

Permalink
Merge pull request #567 from Suvadip-sana/set-edit-image-limit
Browse files Browse the repository at this point in the history
Set the image upload limit of 4 for edit form
  • Loading branch information
Soujanya2004 authored Nov 10, 2024
2 parents eb5e60d + ac46be6 commit 6f6f39e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ app.get("/listing", asyncwrap(index));
app.post("/listing", upload.array('listing[image]', 4), isLoggedIn, asyncwrap(createpost));
app.post("/listing/search", asyncwrap(search));
app.get("/listing/:id/edit", isLoggedIn, isOwner, asyncwrap(editpost));
app.put('/listing/:id', isLoggedIn, isOwner, upload.array('listing[image]', 10), asyncwrap(saveEditpost));
app.put('/listing/:id', isLoggedIn, isOwner, upload.array('listing[image]', 4), asyncwrap(saveEditpost));
app.delete("/listing/:id", isLoggedIn, isOwner, asyncwrap(deletepost));
app.get("/listing/:id", asyncwrap(showPost));
app.post('/listing/:id/like', isLoggedIn, asyncwrap(listingController.likeListing));
Expand Down
4 changes: 2 additions & 2 deletions views/edit.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@

<div class="mb-3 edit_form">
<label for="images" class="form-label">Upload New Images</label>
<input type="file" name="listing[image]" class="form-control" accept="image/*" multiple>
<small class="form-text text-muted">You can upload multiple images.</small>
<input type="file" name="listing[image]" class="form-control" accept="image/*" id="fileInput" multiple>
<small class="form-text text-muted">You can upload multiple <images id="fileError" class="">(Maximum 4)</images></small>
</div>
<div class="row">

Expand Down

0 comments on commit 6f6f39e

Please sign in to comment.