/
dimamir
/
undb
Обзор
Документация
Войти
/
dimamir
/
undb
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/table/src/methods/set-table-form.method.ts
24 строки
706 B
nichenqin
fix: fix event spaceis
18 окт 2024, 11:51
18 окт 2024, 11:51
4b42997
Код
Авторство
О чём код?
import { None, Some, type Option } from "@undb/domain" import type { ISetTableFormDTO } from "../dto" import { SetTableFormEvent } from "../events" import type { TableComositeSpecification } from "../specifications" import type { TableDo } from "../table.do" export function setTableForm(this: TableDo, dto: ISetTableFormDTO): Option<TableComositeSpecification> { const forms = this.forms const spec = forms?.$setForm(dto.form) if (!spec) return None spec.mutate(this) const event = new SetTableFormEvent( { tableId: this.id.value, previous: spec.previous ?? null, form: spec.form.toJSON(), }, this.spaceId, ) this.addDomainEvent(event) return Some(spec) }