mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 07:03:38 +00:00
Fix eslint in plugins folder
This commit is contained in:
parent
c563955d46
commit
e57f02d2d9
@ -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');
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user