/
dimamir
/
undb
Обзор
Документация
Войти
/
dimamir
/
undb
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/table/src/services/methods/create-table-form.method.ts
18 строк
650 B
nichenqin
feat: navigate to new form after create form
19 сен 2024, 06:18
19 сен 2024, 06:18
66b0528
Код
Авторство
О чём код?
import type { FormVO } from "../../modules" import type { ICreateTableFormDTO } from "../../modules/forms/dto/create-form.dto" import { TableIdVo } from "../../table-id.vo" import type { TableDo } from "../../table.do" import type { TableService } from "../table.service" export async function createTableFormMethod( this: TableService, dto: ICreateTableFormDTO, ): Promise<{ table: TableDo; form: FormVO }> { const table = (await this.repository.findOneById(new TableIdVo(dto.tableId))).expect("Not found table") const { spec, form } = table.$createForm(dto) await this.repository.updateOneById(table, spec) return { table, form } }