import {HTTPBody} from '@fastify-modular/route'; import {pito} from 'pito'; import {AdminOnly, NeedLogin} from '../defines'; // ========================================================================== export const CreateFAQInput = pito.Obj({ faqGroup: pito.Str(), title : pito.Str(), contents: pito.Str(), }); export type CreateFAQInput = pito.Type; // ========================================================================== export const CreateFAQOutput = pito.Obj({ faqId: pito.Num(), }); export type CreateFAQOutput = pito.Type; // ========================================================================== export const CreateFAQ = HTTPBody('POST', '/api/v1/product/create-faq', 'cs') .body(CreateFAQInput) .response(CreateFAQOutput) .presets(NeedLogin, AdminOnly) .build();