Skip to content

Commit 5aff890

Browse files
committed
increase max length of bookmarks to 5000 chars
1 parent 8cea727 commit 5aff890

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

backend/src/routes/users/bookmarks/personal-bookmarks.service.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ let increaseOwnerVisitCount = async (userId, bookmarkId) => {
196196
* DELETE bookmark for user
197197
*/
198198
let deleteBookmarkById = async (userId, bookmarkId) => {
199-
const bookmark = await Bookmark.findOneAndRemove({
199+
const response = await Bookmark.deleteOne({
200200
_id: bookmarkId,
201201
userId: userId
202202
});
203203

204-
if ( !bookmark ) {
204+
if ( response.deletedCount !== 1 ) {
205205
throw new NotFoundError('Bookmark NOT_FOUND with id: ' + bookmarkId);
206206
} else {
207207
await User.update(

frontend/src/app/my-bookmarks/save-bookmark-form/save-bookmark-form.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@
142142
placeholder="Writing descriptions with keywords can help find your bookmarks more easily through search. You can give an overview of the bookmark and place keywords in the beginning of the description."
143143
style="height: 250px">
144144
</textarea>
145-
<div class="description-chars-counter">{{description.value ? description.value.length : 0}} / 3000</div>
145+
<div class="description-chars-counter">{{description.value ? description.value.length : 0}} / 5000</div>
146146
<div class="clear"></div>
147147
<div *ngIf="description.invalid && (description.dirty || description.touched)" class="alert alert-danger">
148148
<div *ngIf="description.errors.tooManyLines">
149149
Your description has {{description.errors.tooManyLines.value}} lines. Maximum 300 lines are allowed.
150150
</div>
151151
<div *ngIf="description.errors.tooManyCharacters">
152-
Your description has {{description.errors.tooManyCharacters.value}} characters. Maximum 3000 characters are
152+
Your description has {{description.errors.tooManyCharacters.value}} characters. Maximum 5000 characters are
153153
allowed.
154154
</div>
155155
</div>

frontend/src/app/my-bookmarks/save-bookmark-form/save-bookmark-form.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export class SaveBookmarkFormComponent implements OnInit {
171171
tags: this.formBuilder.array([], [tagsValidator, Validators.required]),
172172
publishedOn: null,
173173
sourceCodeURL: '',
174-
description: [this.desc ? this.desc : '', textSizeValidator(3000, 300)],
174+
description: [this.desc ? this.desc : '', textSizeValidator(5000, 500)],
175175
public: false,
176176
readLater: false,
177177
pinned: false,

0 commit comments

Comments
 (0)