adding chat features, admin features and bug fixes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { api } from './api';
|
||||
import type { BookStackRecentResponse, BookStackSearchResponse } from '../types/bookstack.types';
|
||||
import type { BookStackRecentResponse, BookStackSearchResponse, BookStackPageDetail } from '../types/bookstack.types';
|
||||
|
||||
interface ApiResponse<T> {
|
||||
success: boolean;
|
||||
@@ -14,6 +14,12 @@ export const bookstackApi = {
|
||||
.then((r) => ({ configured: r.data.configured, data: r.data.data }));
|
||||
},
|
||||
|
||||
getPage(id: number): Promise<{ configured: boolean; data: BookStackPageDetail | null }> {
|
||||
return api
|
||||
.get<ApiResponse<BookStackPageDetail | null>>(`/api/bookstack/pages/${id}`)
|
||||
.then((r) => ({ configured: r.data.configured, data: r.data.data }));
|
||||
},
|
||||
|
||||
search(query: string): Promise<BookStackSearchResponse> {
|
||||
return api
|
||||
.get<ApiResponse<BookStackSearchResponse['data']>>('/api/bookstack/search', {
|
||||
|
||||
Reference in New Issue
Block a user