This commit is contained in:
Proddy
2023-04-24 16:50:28 +02:00
parent 9553161b07
commit 005485188f
4 changed files with 19 additions and 22 deletions

View File

@@ -112,22 +112,20 @@ export const entityItemValidation = () =>
}
],
device_id: [
{ required: true, message: 'Device ID is required' },
{
validator(rule: InternalRuleItem, value: string, callback: (error?: string) => void) {
if (isNaN(parseInt(value, 16))) {
callback('Must be a hex number');
callback('Is required and must be in hex format');
}
callback();
}
}
],
type_id: [
{ required: true, message: 'Type ID is required' },
{
validator(rule: InternalRuleItem, value: string, callback: (error?: string) => void) {
if (isNaN(parseInt(value, 16))) {
callback('Must be a hex number');
callback('Is required and must be in hex format');
}
callback();
}