Browse Source

update zod locales

pull/1619/head
Bernd Storath 2 months ago
parent
commit
a79f2f21d4
  1. 25
      src/i18n/locales/en.json
  2. 4
      src/server/database/repositories/interface/types.ts
  3. 4
      src/server/database/repositories/oneTimeLink/types.ts

25
src/i18n/locales/en.json

@ -39,21 +39,6 @@
"migration": "Restore the backup"
},
"zod": {
"stringMalformed": "String is malformed",
"id": "Client ID must be a valid UUID",
"file": "File must be a valid string",
"otl": "oneTimeLink must be a valid string",
"otlMin": "oneTimeLink must be at least 1 Character",
"features": "key must be a valid string",
"ftBool": "enabled must be a valid boolean",
"ftObj": "value must be a valid object",
"ftObj2": "features must be a valid record",
"stat": "statistics must be a valid object",
"statBool": "enabled must be a valid boolean",
"statNumber": "chartType must be a valid number",
"body": "Body must be a valid object",
"device": "Device must be a valid string",
"deviceMin": "Device must be at least 1 Character",
"client": {
"id": "Client ID must be a valid number",
"name": "Name must be a valid string",
@ -87,8 +72,16 @@
},
"interface": {
"cidr": "CIDR must be a valid string",
"cidrMin": "CIDR must be at least 1 Character"
"cidrMin": "CIDR must be at least 1 Character",
"device": "Device must be a valid string",
"deviceMin": "Device must be at least 1 Character"
},
"otl": {
"otl": "oneTimeLink must be a valid string",
"otlMin": "oneTimeLink must be at least 1 Character"
},
"stringMalformed": "String is malformed",
"body": "Body must be a valid object",
"hook": "Hook must be a valid string",
"mtu": "MTU must be a valid number",
"mtuMin": "MTU must be at least 1280",

4
src/server/database/repositories/interface/types.ts

@ -15,8 +15,8 @@ export type InterfaceUpdateType = Omit<
>;
const device = z
.string({ message: 'zod.device' })
.min(1, 'zod.deviceMin')
.string({ message: 'zod.interface.device' })
.min(1, 'zod.interface.deviceMin')
.pipe(safeStringRefine);
const cidr = z

4
src/server/database/repositories/oneTimeLink/types.ts

@ -5,8 +5,8 @@ import { z } from 'zod';
export type OneTimeLinkType = InferSelectModel<typeof oneTimeLink>;
const oneTimeLinkType = z
.string({ message: 'zod.otl' })
.min(1, 'zod.otlMin')
.string({ message: 'zod.otl.otl' })
.min(1, 'zod.otl.otlMin')
.pipe(safeStringRefine);
export const OneTimeLinkGetSchema = z.object(

Loading…
Cancel
Save