start upgrading eslint

This commit is contained in:
Matteo Pagliazzi
2019-10-08 16:57:10 +02:00
parent 90c917f69e
commit 621787915c
304 changed files with 5992 additions and 6394 deletions

View File

@@ -1,8 +1,8 @@
import mongoose from 'mongoose';
import baseModel from '../libs/baseModel';
import { v4 as uuid } from 'uuid';
import validator from 'validator';
import _ from 'lodash';
import baseModel from '../libs/baseModel';
const NOTIFICATION_TYPES = [
'DROPS_ENABLED',
@@ -42,9 +42,9 @@ const NOTIFICATION_TYPES = [
'ACHIEVEMENT_ARID_AUTHORITY',
];
const Schema = mongoose.Schema;
const { Schema } = mongoose;
export let schema = new Schema({
export const schema = new Schema({
id: {
$type: String,
default: uuid,
@@ -60,9 +60,10 @@ export let schema = new Schema({
// required: true,
enum: NOTIFICATION_TYPES,
},
data: {$type: Schema.Types.Mixed, default: () => {
return {};
}},
data: {
$type: Schema.Types.Mixed,
default: () => ({}),
},
// A field to mark the notification as seen without deleting it, optional use
seen: {
$type: Boolean,
@@ -100,9 +101,7 @@ schema.statics.convertNotificationsToSafeJson = function convertNotificationsToS
return false;
});
return filteredNotifications.map(n => {
return n.toJSON();
});
return filteredNotifications.map(n => n.toJSON());
};
schema.plugin(baseModel, {
@@ -111,4 +110,4 @@ schema.plugin(baseModel, {
_id: false, // use id instead of _id
});
export let model = mongoose.model('UserNotification', schema);
export const model = mongoose.model('UserNotification', schema);