mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user