Refactoring search, navigation, canvas and others to fit the new data model

This commit is contained in:
2024-08-06 00:15:09 +02:00
parent e28d72fd1b
commit a3d0b3b5bd
26 changed files with 409 additions and 253 deletions

39
types/api.ts Normal file
View File

@@ -0,0 +1,39 @@
export interface Project {
id: number;
name: string;
owner: number;
home: string;
}
export interface Navigation {
title: string;
path: string;
type: string;
order: number
children?: Navigation[];
}
export interface File {
id: number;
project: number;
path: string;
title: string;
type: 'Markdown' | 'Canvas' | 'File' | 'Folder';
content: string;
owner: number;
}
export interface Comment {
file: number;
user_id: number;
sequence: number;
position: number;
length: number;
content: string;
}
export interface User {
id: number;
username: string;
}
export interface Search {
projects: Project[];
files: File[];
users: User[];
}

View File

@@ -1,8 +1,3 @@
export interface Canvas {
_id: string;
_type: string;
body: CanvasContent
}
export interface CanvasContent {
nodes: CanvasNode[];
edges: CanvasEdge[];