Browse Source

Fix user validation

pull/66/head
Sacha Weatherstone 4 years ago
parent
commit
f7fe27d621
  1. 5
      src/validation/config/user.ts

5
src/validation/config/user.ts

@ -1,11 +1,12 @@
import { IsBoolean, Length } from "class-validator"; import { IsBoolean, IsOptional, IsString, Length } from "class-validator";
import type { Protobuf } from "@meshtastic/meshtasticjs"; import type { Protobuf } from "@meshtastic/meshtasticjs";
export class UserValidation export class UserValidation
implements Omit<Protobuf.User, "macaddr" | "hwModel"> implements Omit<Protobuf.User, "macaddr" | "hwModel">
{ {
@Length(2, 30) @IsString()
@IsOptional()
id: string; id: string;
@Length(2, 30) @Length(2, 30)

Loading…
Cancel
Save