dashpresshq/dashpress

View on GitHub
src/shared/form-schemas/setup/user.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { msg } from "@lingui/macro";

import type { IAppliedSchemaFormConfig } from "../types";

export type ISetupUserForm = {
  name: string;
  username: string;
  password: string;
};

export const SETUP_USER_FORM_SCHEMA: IAppliedSchemaFormConfig<ISetupUserForm> =
  {
    username: {
      label: msg`Username`,
      type: "text",
      validations: [
        {
          validationType: "required",
        },
        {
          validationType: "alphanumeric",
        },
      ],
    },
    name: {
      label: msg`Name`,
      type: "text",
      validations: [
        {
          validationType: "required",
        },
      ],
    },
    password: {
      label: msg`Password`,
      type: "password",
      validations: [
        {
          validationType: "required",
        },
      ],
    },
  };