diff --git a/lib/repository/code.js b/lib/repository/code.js index d8fc2c5..6bac73c 100644 --- a/lib/repository/code.js +++ b/lib/repository/code.js @@ -70,7 +70,7 @@ class CodeRepository { 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'); self.store.insert({ diff --git a/public/src/route/admin/UserDetail.vue b/public/src/route/admin/UserDetail.vue index 644b823..1f0fce2 100644 --- a/public/src/route/admin/UserDetail.vue +++ b/public/src/route/admin/UserDetail.vue @@ -172,10 +172,7 @@ export default { }) .then((response) => { - if (self.user.id) - this.$router.push('/admin/users'); - else - this.$router.push('/admin/users/edit/' + response.data); + this.$router.push('/admin/users'); }) .catch((error) => { shared.$emit('apiError', error, this.$router) }) .then(() =>