Browse Source

refactor: some linting fixes

Kristian Vos 3 years ago
parent
commit
da520c1e72

+ 3 - 5
backend/logic/actions/punishments.js

@@ -50,8 +50,7 @@ export default {
 				// If a filter exists for value, add valueUsername property to all documents
 				(pipeline, next) => {
 					// Check if a filter with the value property exists
-					const valueFilterExists =
-						queries.map(query => query.filter.property).indexOf("value") !== -1;
+					const valueFilterExists = queries.map(query => query.filter.property).indexOf("value") !== -1;
 					// If no such filter exists, skip this function
 					if (!valueFilterExists) return next(null, pipeline);
 
@@ -92,7 +91,7 @@ export default {
 						$addFields: {
 							valueUsername: {
 								$cond: [
-									{ $eq: [ "$type", "banUserId" ] },
+									{ $eq: ["$type", "banUserId"] },
 									{ $ifNull: ["$valueUser.username", "unknown"] },
 									null
 								]
@@ -202,8 +201,7 @@ export default {
 							newQuery[filter.property] = { $eq: data };
 						}
 
-						if (filter.property === "value")
-							return { $or: [newQuery, { valueUsername: newQuery.value }] };
+						if (filter.property === "value") return { $or: [newQuery, { valueUsername: newQuery.value }] };
 						if (filter.property === "punishedBy")
 							return { $or: [newQuery, { punishedByUsername: newQuery.punishedBy }] };
 

+ 1 - 1
backend/logic/actions/users.js

@@ -264,7 +264,7 @@ export default {
 							"services.password.set.code": 0,
 							"services.password.set.expires": 0,
 							"services.github.access_token": 0,
-							"email.verificationToken": 0,
+							"email.verificationToken": 0
 						}
 					});
 

+ 1 - 1
backend/logic/playlists.js

@@ -929,7 +929,7 @@ class _PlaylistsModule extends CoreClass {
 							$addFields: {
 								createdByUsername: {
 									$cond: [
-										{ $eq: [ "$createdBy", "Musare" ] },
+										{ $eq: ["$createdBy", "Musare"] },
 										"Musare",
 										{ $ifNull: ["$createdByUser.username", "unknown"] }
 									]

+ 3 - 4
backend/logic/stations.js

@@ -403,7 +403,7 @@ class _StationsModule extends CoreClass {
 	 * @param {string} payload.operator - the operator for queries
 	 * @returns {Promise} - returns a promise (resolve, reject)
 	 */
-	 GET_DATA(payload) {
+	GET_DATA(payload) {
 		return new Promise((resolve, reject) => {
 			async.waterfall(
 				[
@@ -415,8 +415,7 @@ class _StationsModule extends CoreClass {
 						const { queries } = payload;
 
 						// Check if a filter with the owner property exists
-						const ownerFilterExists =
-							queries.map(query => query.filter.property).indexOf("owner") !== -1;
+						const ownerFilterExists = queries.map(query => query.filter.property).indexOf("owner") !== -1;
 						// If no such filter exists, skip this function
 						if (!ownerFilterExists) return next(null, pipeline);
 
@@ -457,7 +456,7 @@ class _StationsModule extends CoreClass {
 							$addFields: {
 								ownerUsername: {
 									$cond: [
-										{ $eq: [ { $type: "$owner" }, "string" ] },
+										{ $eq: [{ $type: "$owner" }, "string"] },
 										{ $ifNull: ["$ownerUser.username", "unknown"] },
 										"none"
 									]