Fix network validation
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { IsBoolean, IsEnum, IsIP, Length } from "class-validator";
|
||||
import { IsBoolean, IsEnum, IsIP, IsOptional, Length } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
@@ -9,10 +9,12 @@ export class NetworkValidation implements Protobuf.Config_NetworkConfig {
|
||||
@IsEnum(Protobuf.Config_NetworkConfig_WiFiMode)
|
||||
wifiMode: Protobuf.Config_NetworkConfig_WiFiMode;
|
||||
|
||||
@Length(1, 33)
|
||||
@Length(0, 33) //min 1
|
||||
@IsOptional({})
|
||||
wifiSsid: string;
|
||||
|
||||
@Length(8, 64)
|
||||
@Length(0, 64) //min 8
|
||||
@IsOptional()
|
||||
wifiPsk: string;
|
||||
|
||||
@Length(2, 30)
|
||||
@@ -31,14 +33,18 @@ export class NetworkValidation_IpV4Config
|
||||
implements Protobuf.Config_NetworkConfig_IpV4Config
|
||||
{
|
||||
@IsIP()
|
||||
@IsOptional()
|
||||
ip: number;
|
||||
|
||||
@IsIP()
|
||||
@IsOptional()
|
||||
gateway: number;
|
||||
|
||||
@IsIP()
|
||||
@IsOptional()
|
||||
subnet: number;
|
||||
|
||||
@IsIP()
|
||||
@IsOptional()
|
||||
dns: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user