Skip to content

Commit 6f6f39e

Browse files
authored
Merge pull request #567 from Suvadip-sana/set-edit-image-limit
Set the image upload limit of 4 for edit form
2 parents eb5e60d + ac46be6 commit 6f6f39e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ app.get("/listing", asyncwrap(index));
231231
app.post("/listing", upload.array('listing[image]', 4), isLoggedIn, asyncwrap(createpost));
232232
app.post("/listing/search", asyncwrap(search));
233233
app.get("/listing/:id/edit", isLoggedIn, isOwner, asyncwrap(editpost));
234-
app.put('/listing/:id', isLoggedIn, isOwner, upload.array('listing[image]', 10), asyncwrap(saveEditpost));
234+
app.put('/listing/:id', isLoggedIn, isOwner, upload.array('listing[image]', 4), asyncwrap(saveEditpost));
235235
app.delete("/listing/:id", isLoggedIn, isOwner, asyncwrap(deletepost));
236236
app.get("/listing/:id", asyncwrap(showPost));
237237
app.post('/listing/:id/like', isLoggedIn, asyncwrap(listingController.likeListing));

views/edit.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@
124124

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

0 commit comments

Comments
 (0)