refactor: NIP validator fix
This commit is contained in:
parent
eda1e5c57a
commit
2245c8440d
|
|
@ -34,7 +34,7 @@ module.exports = {
|
|||
{
|
||||
ID_GURU: uuidv4(),
|
||||
ID: teacherId,
|
||||
NIP: 1234567890123456,
|
||||
NIP: "192049384959182948",
|
||||
},
|
||||
]);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ const TeacherModel = (DataTypes) => {
|
|||
notEmpty: true,
|
||||
is16Digits(value) {
|
||||
const stringValue = value.toString();
|
||||
if (stringValue.length !== 16) {
|
||||
throw new Error("NIP must be exactly 16 digits long");
|
||||
if (stringValue.length !== 18) {
|
||||
throw new Error("NIP must be exactly 18 digits long");
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user