mirror of
https://github.com/arthur-pbty/portfolio2023.git
synced 2026-06-24 22:25:16 +02:00
modified
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const Validator_1 = global[Symbol.for('ioc.use')]("Adonis/Core/Validator");
|
||||
class CreateUserValidator {
|
||||
constructor(ctx) {
|
||||
this.ctx = ctx;
|
||||
this.schema = Validator_1.schema.create({
|
||||
pseudo: Validator_1.schema.string(),
|
||||
email: Validator_1.schema.string({}, [Validator_1.rules.email(), Validator_1.rules.unique({ table: 'users', column: 'email' })]),
|
||||
password: Validator_1.schema.string({}, [Validator_1.rules.minLength(4), Validator_1.rules.confirmed()])
|
||||
});
|
||||
this.messages = {
|
||||
required: 'The {{ field }} is required to create a new account',
|
||||
'email.email': 'Vous devez saisir un email dans le champ email',
|
||||
'email.unique': 'Email is already in use',
|
||||
'password.minLength': 'The password must be at least 4 characters long'
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.default = CreateUserValidator;
|
||||
//# sourceMappingURL=CreateUserValidator.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CreateUserValidator.js","sourceRoot":"","sources":["../../../app/Validators/CreateUserValidator.ts"],"names":[],"mappings":";;AAAA,2EAA0E;AAG1E,MAAqB,mBAAmB;IACtC,YAAsB,GAAwB;QAAxB,QAAG,GAAH,GAAG,CAAqB;QAqBvC,WAAM,GAAG,kBAAM,CAAC,MAAM,CAAC;YAC5B,MAAM,EAAE,kBAAM,CAAC,MAAM,EAAE;YACvB,KAAK,EAAE,kBAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,iBAAK,CAAC,KAAK,EAAE,EAAE,iBAAK,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAE,CAAC;YAC7F,QAAQ,EAAE,kBAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,iBAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,iBAAK,CAAC,SAAS,EAAE,CAAE,CAAC;SACtE,CAAC,CAAA;QAaK,aAAQ,GAAmB;YAChC,QAAQ,EAAE,qDAAqD;YAC/D,aAAa,EAAE,gDAAgD;YAC/D,cAAc,EAAE,yBAAyB;YACzC,oBAAoB,EAAE,iDAAiD;SACxE,CAAA;IA3CgD,CAAC;CA4CnD;AA7CD,sCA6CC"}
|
||||
Reference in New Issue
Block a user