Be able to create an user from the Content Manager

This commit is contained in:
Aurelsicoko 2017-12-05 15:28:31 +01:00
parent a4dbc278a7
commit 110c209431
4 changed files with 11 additions and 5 deletions

View File

@ -24,7 +24,7 @@ class LeftMenuLink extends React.Component { // eslint-disable-line react/prefer
className={`${styles.link} ${isLinkActive ? styles.linkActive : ''}`}
to={{
pathname: this.props.destination,
search: `${this.props.source ? '?source=' : ''}${this.props.source}`,
search: this.props.source ? `?source=${this.props.source}` : '',
}}
>
<i className={`${styles.linkIcon} fa-${this.props.icon} fa`}></i>

File diff suppressed because one or more lines are too long

View File

@ -131,9 +131,15 @@ export class Edit extends React.Component {
componentWillReceiveProps(nextProps) {
if (this.props.editSuccess !== nextProps.editSuccess) {
if (!isEmpty(this.props.location.search) && includes(this.props.location.search, '?redirectUrl')) {
router.push(replace(this.props.location.search, '?redirectUrl=', ''));
router.push({
pathname: replace(this.props.location.search, '?redirectUrl=', ''),
search: `?source=${this.source}`,
});
} else {
router.push(replace(this.props.location.pathname, 'create', ''));
router.push({
pathname: replace(this.props.location.pathname, '/create', ''),
search: `?source=${this.source}`,
});
}
}
}

View File

@ -44,7 +44,7 @@ module.exports = {
}
if (!values.provider) {
values.password = 'local';
values.provider = 'local';
}
return strapi.query('user', 'users-permissions').create(values);