MVP Version

This commit is contained in:
Stefan Hardegger
2025-07-23 12:28:48 +02:00
parent 59d29dceaf
commit d69bed00a2
22 changed files with 1781 additions and 153 deletions

View File

@@ -82,6 +82,7 @@ export const storyApi = {
authorId?: string;
authorName?: string;
seriesId?: string;
seriesName?: string;
tagNames?: string[];
}): Promise<Story> => {
const response = await api.post('/stories', storyData);
@@ -97,6 +98,7 @@ export const storyApi = {
volume?: number;
authorId?: string;
seriesId?: string;
seriesName?: string;
tagNames?: string[];
}): Promise<Story> => {
const response = await api.put(`/stories/${id}`, storyData);
@@ -133,6 +135,16 @@ export const storyApi = {
const response = await api.delete(`/stories/${storyId}/tags/${tagId}`);
return response.data;
},
reindexTypesense: async (): Promise<{ success: boolean; message: string; count?: number; error?: string }> => {
const response = await api.post('/stories/reindex-typesense');
return response.data;
},
recreateTypesenseCollection: async (): Promise<{ success: boolean; message: string; count?: number; error?: string }> => {
const response = await api.post('/stories/recreate-typesense-collection');
return response.data;
},
};
// Author endpoints
@@ -171,6 +183,39 @@ export const authorApi = {
removeAvatar: async (id: string): Promise<void> => {
await api.delete(`/authors/${id}/avatar`);
},
searchAuthorsTypesense: async (params?: {
q?: string;
page?: number;
size?: number;
sortBy?: string;
sortOrder?: string;
}): Promise<{
results: Author[];
totalHits: number;
page: number;
perPage: number;
query: string;
searchTimeMs: number;
}> => {
const response = await api.get('/authors/search-typesense', { params });
return response.data;
},
reindexTypesense: async (): Promise<{ success: boolean; message: string; count?: number; error?: string }> => {
const response = await api.post('/authors/reindex-typesense');
return response.data;
},
recreateTypesenseCollection: async (): Promise<{ success: boolean; message: string; count?: number; error?: string }> => {
const response = await api.post('/authors/recreate-typesense-collection');
return response.data;
},
getTypesenseSchema: async (): Promise<{ success: boolean; schema?: any; error?: string }> => {
const response = await api.get('/authors/typesense-schema');
return response.data;
},
};
// Tag endpoints