mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
start upgrading eslint
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import mongoose from 'mongoose';
|
||||
|
||||
let api = {};
|
||||
const api = {};
|
||||
|
||||
let tasksModels = ['habit', 'daily', 'todo', 'reward'];
|
||||
let allModels = ['user', 'tag', 'challenge', 'group'].concat(tasksModels);
|
||||
const tasksModels = ['habit', 'daily', 'todo', 'reward'];
|
||||
const allModels = ['user', 'tag', 'challenge', 'group'].concat(tasksModels);
|
||||
|
||||
/**
|
||||
* @api {get} /api/v3/models/:model/paths Get all paths for the specified model
|
||||
@@ -36,10 +36,10 @@ api.getModelPaths = {
|
||||
async handler (req, res) {
|
||||
req.checkParams('model', res.t('modelNotFound')).notEmpty().isIn(allModels);
|
||||
|
||||
let validationErrors = req.validationErrors();
|
||||
const validationErrors = req.validationErrors();
|
||||
if (validationErrors) throw validationErrors;
|
||||
|
||||
let model = req.params.model;
|
||||
let { model } = req.params;
|
||||
// tasks models are lowercase, the others have the first letter uppercase (User, Group)
|
||||
if (tasksModels.indexOf(model) === -1) {
|
||||
model = model.charAt(0).toUpperCase() + model.slice(1);
|
||||
|
||||
Reference in New Issue
Block a user