/
dimamir
/
undb
Обзор
Документация
Войти
/
dimamir
/
undb
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/table/src/methods/delete-form.method.ts
24 строки
725 B
nichenqin
feat: delete form
04 сен 2024, 11:21
04 сен 2024, 11:21
ef2b934
Код
Авторство
О чём код?
import { None, Some, type Option } from "@undb/domain" import type { IDeleteTableFormDTO } from "../modules/forms/dto/delete-form.dto" import { WithoutFormSpecification, type TableComositeSpecification } from "../specifications" import type { TableDo } from "../table.do" export function deleteFormMethod( this: TableDo, { id: formId }: IDeleteTableFormDTO, ): Option<TableComositeSpecification> { const form = this.forms?.props.find((f) => f.id === formId) if (!form) return None const spec = new WithoutFormSpecification(formId) spec.mutate(this) // const event = new FormDeletedEvent({ // tableId: this.id.value, // formId: form.id, // }) // this.addDomainEvent(event) return Some(spec) }