add update document request / response zod schema

This commit is contained in:
thierryverse 2025-11-20 09:56:22 +02:00 committed by CREDO23
parent 0fa969925a
commit dd652e36fc

View file

@ -142,6 +142,16 @@ export const getDocumentByChunkRequest = z.object({
export const getDocumentByChunkResponse = documentWithChunks; export const getDocumentByChunkResponse = documentWithChunks;
/**
* Update document
*/
export const updateDocumentRequest = z.object({
id: z.number(),
data: document.pick({ search_space_id: true, document_type: true, content: true }),
});
export const updateDocumentResponse = document;
export type GetDocumentsRequest = z.infer<typeof getDocumentsRequest>; export type GetDocumentsRequest = z.infer<typeof getDocumentsRequest>;
export type GetDocumentsResponse = z.infer<typeof getDocumentsResponse>; export type GetDocumentsResponse = z.infer<typeof getDocumentsResponse>;
export type GetDocumentRequest = z.infer<typeof getDocumentRequest>; export type GetDocumentRequest = z.infer<typeof getDocumentRequest>;
@ -156,3 +166,5 @@ export type GetDocumentTypeCountsRequest = z.infer<typeof getDocumentTypeCountsR
export type GetDocumentTypeCountsResponse = z.infer<typeof getDocumentTypeCountsResponse>; export type GetDocumentTypeCountsResponse = z.infer<typeof getDocumentTypeCountsResponse>;
export type GetDocumentByChunkRequest = z.infer<typeof getDocumentByChunkRequest>; export type GetDocumentByChunkRequest = z.infer<typeof getDocumentByChunkRequest>;
export type GetDocumentByChunkResponse = z.infer<typeof getDocumentByChunkResponse>; export type GetDocumentByChunkResponse = z.infer<typeof getDocumentByChunkResponse>;
export type UpdateDocumentRequest = z.infer<typeof updateDocumentRequest>;
export type UpdateDocumentResponse = z.infer<typeof updateDocumentResponse>;