Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

504 B
Raw Blame
import type { CreateAdminUserRequest } from "@/fetchers/admin/types";

export type CreateUserValues = CreateAdminUserRequest;

export const EMPTY_CREATE_USER_VALUES: CreateUserValues = {
  name: "",
  email: "",
  role: "user",
};

export function buildCreateUserRequest(
  values: CreateUserValues,
): CreateAdminUserRequest | null {
  const name = values.name.trim();
  const email = values.email.trim().toLowerCase();
  if (!name || !email) return null;
  return { name, email, role: values.role };
}