wip(backend): Cloning of people
This commit is contained in:
parent
e37548fcf7
commit
d0b8572f46
6 changed files with 127 additions and 30 deletions
|
@ -67,7 +67,7 @@ UserModel.prototype.cloak = function (data) {
|
|||
*
|
||||
* Stores result in this.record
|
||||
*/
|
||||
UserModel.prototype.readForReturn = async function (where) {
|
||||
UserModel.prototype.guardedRead = async function (where) {
|
||||
await this.read(where)
|
||||
|
||||
return this.setResponse(200, false, {
|
||||
|
@ -136,7 +136,7 @@ UserModel.prototype.setExists = function () {
|
|||
/*
|
||||
* Creates a user+confirmation and sends out signup email
|
||||
*/
|
||||
UserModel.prototype.create = async function ({ body }) {
|
||||
UserModel.prototype.guardedCreate = async function ({ body }) {
|
||||
if (Object.keys(body) < 1) return this.setResponse(400, 'postBodyMissing')
|
||||
if (!body.email) return this.setResponse(400, 'emailMissing')
|
||||
if (!body.language) return this.setResponse(400, 'languageMissing')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue