1
0
Fork 0

wip(backend): Cloning of people

This commit is contained in:
joostdecock 2022-11-14 18:26:20 +01:00
parent e37548fcf7
commit d0b8572f46
6 changed files with 127 additions and 30 deletions

View file

@ -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')