Browse Source

fix: fixed issue with playlist validation limit

Kristian Vos 5 years ago
parent
commit
26623635a5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      backend/logic/db/index.js

+ 2 - 2
backend/logic/db/index.js

@@ -166,9 +166,9 @@ let lib = {
 					return (isLength(displayName, 1, 16) && regex.ascii.test(displayName));
 				}, 'Invalid display name.');
 	
-				lib.schemas.playlist.path('createdBy').validate((createdBy, callback) => {
+				lib.schemas.playlist.path('createdBy').validate((createdBy) => {
 					lib.models.playlist.countDocuments({ createdBy: createdBy }, (err, c) => {
-						callback(!(err || c >= 10));
+						return !(err || c >= 10);
 					});
 				}, 'Max 10 playlists per user.');