Fixed another unconverted function call
Fixed redirect after adding a user (no need to go to the edit page afterwards like with codes)
This commit is contained in:
parent
92ed107558
commit
2f46dbff2c
|
@ -70,7 +70,7 @@ class CodeRepository
|
||||||
{
|
{
|
||||||
var codeId = generate(config.code.alphabet, config.code.length);
|
var codeId = generate(config.code.alphabet, config.code.length);
|
||||||
|
|
||||||
if ((await self.findCodeUserId(codeId)) !== null)
|
if ((await self.getUserId(codeId)) !== null)
|
||||||
throw new Error('Code ' + codeId + ' already exists');
|
throw new Error('Code ' + codeId + ' already exists');
|
||||||
|
|
||||||
self.store.insert({
|
self.store.insert({
|
||||||
|
|
|
@ -172,10 +172,7 @@ export default {
|
||||||
})
|
})
|
||||||
.then((response) =>
|
.then((response) =>
|
||||||
{
|
{
|
||||||
if (self.user.id)
|
this.$router.push('/admin/users');
|
||||||
this.$router.push('/admin/users');
|
|
||||||
else
|
|
||||||
this.$router.push('/admin/users/edit/' + response.data);
|
|
||||||
})
|
})
|
||||||
.catch((error) => { shared.$emit('apiError', error, this.$router) })
|
.catch((error) => { shared.$emit('apiError', error, this.$router) })
|
||||||
.then(() =>
|
.then(() =>
|
||||||
|
|
Loading…
Reference in New Issue