Fix channel name validation

This commit is contained in:
Sacha Weatherstone
2022-10-29 23:30:35 +10:00
parent 5c68c552e2
commit 5bf1d3eeaf
2 changed files with 22 additions and 13 deletions
+11 -4
View File
@@ -1,13 +1,20 @@
import { IsBoolean, IsInt, Length } from "class-validator";
import { IsBoolean, IsInt, IsNumber, IsString, Length } from "class-validator";
import type { Protobuf } from "@meshtastic/meshtasticjs";
export class ChannelSettingsValidation
implements Omit<Protobuf.ChannelSettings, "channelNum">
implements Omit<Protobuf.ChannelSettings, "psk">
{
psk: Uint8Array;
@IsBoolean()
enabled: boolean;
@Length(1, 30)
@IsString()
psk: string;
@IsNumber()
channelNum: number;
@Length(1, 11)
name: string;
@IsInt()