Fix eslint in plugins folder

This commit is contained in:
Alexandre Bodin 2022-09-05 15:18:24 +02:00
parent c563955d46
commit e57f02d2d9
3 changed files with 7 additions and 6 deletions

View File

@ -15,12 +15,13 @@ module.exports = ({ strapi }) => {
return {
registerDoc(doc) {
let registeredDoc = doc;
// parseYaml
if (typeof doc === 'string') {
doc = require('yaml').parse(doc);
registeredDoc = require('yaml').parse(registeredDoc);
}
// receive an object we can register it directly
registeredDocs.push(doc);
registeredDocs.push(registeredDoc);
},
getDocumentationVersion() {
return _.get(config, 'info.version');

View File

@ -147,7 +147,7 @@ module.exports = {
.query('plugin::users-permissions.user')
.findOne({ where: { username } });
if (userWithSameUsername && userWithSameUsername.id != id) {
if (userWithSameUsername && _.toString(userWithSameUsername.id) !== _.toString(id)) {
throw new ApplicationError('Username already taken');
}
}
@ -157,7 +157,7 @@ module.exports = {
.query('plugin::users-permissions.user')
.findOne({ where: { email: _.toLower(email) } });
if (userWithSameEmail && userWithSameEmail.id != id) {
if (userWithSameEmail && _.toString(userWithSameEmail.id) !== _.toString(id)) {
throw new ApplicationError('Email already taken');
}
body.email = _.toLower(body.email);

View File

@ -105,7 +105,7 @@ module.exports = {
.query('plugin::users-permissions.user')
.findOne({ where: { username } });
if (userWithSameUsername && userWithSameUsername.id != id) {
if (userWithSameUsername && _.toString(userWithSameUsername.id) !== _.toString(id)) {
throw new ApplicationError('Username already taken');
}
}
@ -115,7 +115,7 @@ module.exports = {
.query('plugin::users-permissions.user')
.findOne({ where: { email: email.toLowerCase() } });
if (userWithSameEmail && userWithSameEmail.id != id) {
if (userWithSameEmail && _.toString(userWithSameEmail.id) !== _.toString(id)) {
throw new ApplicationError('Email already taken');
}
ctx.request.body.email = ctx.request.body.email.toLowerCase();