-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
/** * @packageDocumentation * @module api.functional.bbs.articles * @nestia Generated by Nestia - https://github.com/samchon/nestia */ //================================================================ import { Fetcher } from "@nestia/fetcher"; import type { IConnection } from "@nestia/fetcher"; import typia from "typia"; import { NestiaSimulator } from "./../../../utils/NestiaSimulator"; import type { IBbsArticle } from "./../../../structures/IBbsArticle"; /** * Update an article. * * @param section Section code * @param id Target article ID * @param input Content to update * @returns Updated content * * @controller BbsArticlesController.update() * @path PUT /bbs/:section/articles/:id * @nestia Generated by Nestia - https://github.com/samchon/nestia */ export async function update( connection: IConnection, section: string, id: string, input: update.Input, ): Promise { return !!connection.random ? update.simulate( connection, section, id, input, ) : Fetcher.fetch( connection, update.ENCRYPTED, update.METHOD, update.path(section, id), input, ); } export namespace update { export type Input = IBbsArticle.IStore; export type Output = IBbsArticle; export const METHOD = "PUT" as const; export const PATH: string = "/bbs/:section/articles/:id"; export const ENCRYPTED: Fetcher.IEncrypted = { request: false, response: false, }; export const path = (section: string, id: string): string => { return `/bbs/${encodeURIComponent(section ?? "null")}/articles/${encodeURIComponent(id ?? "null")}`; } export const random = (g?: Partial): Output => typia.random(g); export const simulate = async ( connection: IConnection, section: string, id: string, input: update.Input, ): Promise => { const assert = NestiaSimulator.assert({ method: METHOD, host: connection.host, path: path(section, id) }); assert.param("section")("string")(() => typia.assert(section)); assert.param("id")("uuid")(() => typia.assert(id)); assert.body(() => typia.assert(input)); return typia.random( typeof connection.random === 'object' && connection.random !== null ? connection.random : undefined ); } }