refactor: NIP validator fix

This commit is contained in:
elangptra 2024-12-19 10:31:46 +07:00
parent eda1e5c57a
commit 2245c8440d
2 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ module.exports = {
{ {
ID_GURU: uuidv4(), ID_GURU: uuidv4(),
ID: teacherId, ID: teacherId,
NIP: 1234567890123456, NIP: "192049384959182948",
}, },
]); ]);
}, },

View File

@ -32,8 +32,8 @@ const TeacherModel = (DataTypes) => {
notEmpty: true, notEmpty: true,
is16Digits(value) { is16Digits(value) {
const stringValue = value.toString(); const stringValue = value.toString();
if (stringValue.length !== 16) { if (stringValue.length !== 18) {
throw new Error("NIP must be exactly 16 digits long"); throw new Error("NIP must be exactly 18 digits long");
} }
}, },
}, },