Logo
Explore Help
Register Sign In
yujunjun/strapi
1
0
Fork 0
You've already forked strapi
mirror of https://github.com/strapi/strapi.git synced 2025-07-18 14:32:56 +00:00
Code Issues Packages Projects Releases Wiki Activity
strapi/packages/strapi-admin/services/user.js

21 lines
397 B
JavaScript
Raw Normal View History

Add tests Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-05-13 11:46:52 +02:00
'use strict';
Add new POST /admin/users route (controller + related services). Update User model: remove required constraint on password field. Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-05-13 12:27:46 +02:00
module.exports = {
withDefaults(attributes) {
return {
roles: [],
isActive: false,
...attributes,
};
},
Add tests Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-05-13 11:46:52 +02:00
Add new POST /admin/users route (controller + related services). Update User model: remove required constraint on password field. Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-05-13 12:27:46 +02:00
async create(attributes) {
const user = this.withDefaults(attributes);
return strapi.query('user', 'admin').create(user);
},
Add tests Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-05-13 11:46:52 +02:00
Add new POST /admin/users route (controller + related services). Update User model: remove required constraint on password field. Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-05-13 12:27:46 +02:00
async exists(attributes) {
return !!(await strapi.query('user', 'admin').findOne(attributes));
},
Add tests Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-05-13 11:46:52 +02:00
};
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.5 Page: 996ms Template: 27ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API