new features, bookstack

This commit is contained in:
Matthias Hochmeister
2026-03-03 21:30:38 +01:00
parent 817329db70
commit d3561c1109
32 changed files with 1923 additions and 207 deletions

View File

@@ -0,0 +1,24 @@
import { api } from './api';
import type { BookStackRecentResponse, BookStackSearchResponse } from '../types/bookstack.types';
interface ApiResponse<T> {
success: boolean;
data: T;
configured: boolean;
}
export const bookstackApi = {
getRecent(): Promise<BookStackRecentResponse> {
return api
.get<ApiResponse<BookStackRecentResponse['data']>>('/api/bookstack/recent')
.then((r) => ({ configured: r.data.configured, data: r.data.data }));
},
search(query: string): Promise<BookStackSearchResponse> {
return api
.get<ApiResponse<BookStackSearchResponse['data']>>('/api/bookstack/search', {
params: { query },
})
.then((r) => ({ configured: r.data.configured, data: r.data.data }));
},
};

View File

@@ -146,4 +146,11 @@ export const eventsApi = {
)
.then((r) => r.data.data);
},
/** Bulk-import events from CSV-parsed data */
importEvents(events: CreateVeranstaltungInput[]): Promise<{ created: number; errors: string[] }> {
return api
.post<ApiResponse<{ created: number; errors: string[] }>>('/api/events/import', { events })
.then((r) => r.data.data);
},
};