/
dimamir
/
undb
Обзор
Документация
Войти
/
dimamir
/
undb
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/commands/src/update-view.command.ts
49 строк
1 KB
nichenqin
feat: pivot view
13 ноя 2024, 05:38
13 ноя 2024, 05:38
9b1b751
Код
Авторство
О чём код?
import { Command,type CommandProps } from "@undb/domain" import { updateViewDTO, type ICalendarOption, type IGalleryOption, type IKanbanOption, type IPivotOption, type ViewType, } from "@undb/table" import { z } from "@undb/zod" export const updateViewCommand = updateViewDTO export type IUpdateViewCommand = z.infer<typeof updateViewCommand> export class UpdateViewCommand extends Command { public readonly tableId: string public readonly viewId?: string public readonly name: string public readonly type: ViewType public readonly kanban?: IKanbanOption public readonly gallery?: IGalleryOption public readonly calendar?: ICalendarOption public readonly pivot?: IPivotOption constructor(props: CommandProps<IUpdateViewCommand>) { super(props) this.tableId = props.tableId this.viewId = props.viewId this.name = props.name this.type = props.type if (props.type === "kanban") { // @ts-ignore this.kanban = props.kanban } if (props.type === "gallery") { // @ts-ignore this.gallery = props.gallery } if (props.type === "calendar") { // @ts-ignore this.calendar = props.calendar } if (props.type === "pivot") { // @ts-ignore this.pivot = props.pivot } } }