refs #6397 emailValidation #1941

Merged
carlossa merged 13 commits from 6397-emailValidation into dev 2024-02-01 17:45:54 +00:00
1 changed files with 11 additions and 6 deletions
Showing only changes of commit 23b8703afc - Show all commits

View File

@ -1,3 +1,5 @@
const {error} = require('fancy-log');
module.exports = function(Self) {
Self.remoteMethod('createWithUser', {
description: 'Creates both client and its web account',
@ -29,12 +31,15 @@ module.exports = function(Self) {
myOptions.transaction = tx;
}
if (data.email) {
Review

@alexm valorares la opcio de posar-ho en back/models/vn-user.js com a una validacio nativa?

@alexm valorares la opcio de posar-ho en back/models/vn-user.js com a una validacio nativa?
Review

Per mi si, pero hi hauria que mirar els nulls que hi hajen com se comporta la restriccio, pq segurament qualsevol canvi en el model fallara

Per mi si, pero hi hauria que mirar els nulls que hi hajen com se comporta la restriccio, pq segurament qualsevol canvi en el model fallara
const firstEmail = data.email ? data.email.split(',')[0] : null;
const user = {
name: data.userName,
email: firstEmail,
password: String(Math.random() * 100000000000000)
};
} else
throw error;
try {
const account = await models.VnUser.create(user, myOptions);