mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 08:46:22 +02:00
feat: add source_markdown column to documents and implement migration logic for existing records using a pure-Python BlockNote JSON to Markdown converter
This commit is contained in:
parent
f2a2872995
commit
8b497da130
22 changed files with 632 additions and 920 deletions
|
|
@ -6,7 +6,7 @@ import { baseApiService } from "./base-api.service";
|
|||
const createNoteRequest = z.object({
|
||||
search_space_id: z.number(),
|
||||
title: z.string().min(1),
|
||||
blocknote_document: z.array(z.any()).optional(),
|
||||
source_markdown: z.string().optional(),
|
||||
});
|
||||
|
||||
const createNoteResponse = z.object({
|
||||
|
|
@ -82,12 +82,12 @@ class NotesApiService {
|
|||
throw new ValidationError(`Invalid request: ${errorMessage}`);
|
||||
}
|
||||
|
||||
const { search_space_id, title, blocknote_document } = parsedRequest.data;
|
||||
const { search_space_id, title, source_markdown } = parsedRequest.data;
|
||||
|
||||
// Send both title and blocknote_document in request body
|
||||
// Send both title and source_markdown in request body
|
||||
const body = {
|
||||
title,
|
||||
...(blocknote_document && { blocknote_document }),
|
||||
...(source_markdown !== undefined && { source_markdown }),
|
||||
};
|
||||
|
||||
return baseApiService.post(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue