-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.validations.js
70 lines (62 loc) · 2.11 KB
/
schema.validations.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// import Joi from 'joi';
// export function validateRegister(body) {
// const schema = Joi.object({
// email: Joi.string().email().min(3).required(),
// password: Joi.string().min(6).max(20).required(),
// name: Joi.string().min(3).max(24).required(),
// language: Joi.string().valid('tr', 'en').required(),
// platform: Joi.string().valid('Android', 'IOS').required(),
// timezone: Joi.number().required(),
// deviceId: Joi.string().min(4).required()
// });
// return schema.validate(body);
// }
// export function validateLogin(body) {
// const schema = Joi.object({
// email: Joi.string().email().min(3).required(),
// password: Joi.string().min(6).max(20).required()
// });
// return schema.validate(body);
// }
// export function validateSendVerificationCode(body) {
// const schema = Joi.object({
// email: Joi.string().email().min(3).required()
// });
// return schema.validate(body);
// }
// export function validateVerifyEmail(body) {
// const schema = Joi.object({
// token: Joi.string().min(10).required(),
// code: Joi.string().length(4).required()
// });
// return schema.validate(body);
// }
// export function validateRefreshToken(body) {
// const schema = Joi.object({
// refreshToken: Joi.string().min(10).required()
// });
// return schema.validate(body);
// }
// export function validateForgotPassword(body) {
// const schema = Joi.object({
// password: Joi.string().min(6).max(20).required()
// });
// return schema.validate(body);
// }
// export function validateChangePassword(body) {
// const schema = Joi.object({
// oldPassword: Joi.string().min(6).max(20).required(),
// newPassword: Joi.string().min(6).max(20).required()
// });
// return schema.validate(body);
// }
// export function validateEditUser(body) {
// const schema = Joi.object({
// name: Joi.string().min(3).max(24),
// username: Joi.string().min(3).max(15),
// language: Joi.string().valid('tr', 'en'),
// gender: Joi.string().valid('male', 'female', 'other'),
// birthDate: Joi.date()
// });
// return schema.validate(body);
// }