/
dimamir
/
undb
Обзор
Документация
Войти
/
dimamir
/
undb
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/commands/src/create-base.command.ts
27 строк
712 B
nichenqin
feat: create table accept base name
21 сен 2024, 04:55
21 сен 2024, 04:55
831a400
Код
Авторство
О чём код?
import { createBaseDTO } from "@undb/base" import { Command, type CommandProps } from "@undb/domain" import { z } from "@undb/zod" import { createTableCommand } from "./create-table.command" export const createBaseCommand = createBaseDTO .omit({ id: true, }) .merge( z.object({ tables: createTableCommand.array().optional(), }), ) export type ICreateBaseCommand = z.infer<typeof createBaseCommand> export class CreateBaseCommand extends Command implements ICreateBaseCommand { public readonly name: string public readonly spaceId: string constructor(props: CommandProps<ICreateBaseCommand>) { super(props) this.name = props.name this.spaceId = props.spaceId } }