feat: add new page and migration scripts for access rules and collections
- Introduced new page component for library topics with type checks. - Added migration scripts to update access rules for various collections including badges, curriculum versions, and themes. - Implemented PocketBase integration for managing collection access rules dynamically. - Ensured proper type validation for page props and metadata generation functions.
This commit is contained in:
@@ -19,16 +19,22 @@ async function handleResponse<T>(res: Response): Promise<T> {
|
||||
return res.json() as Promise<T>
|
||||
}
|
||||
|
||||
export async function postIngest(formData: FormData): Promise<{ jobId: string }> {
|
||||
export async function postIngest(payload: {
|
||||
documentId: string
|
||||
filename: string
|
||||
format: 'pdf' | 'md' | 'txt'
|
||||
fileUrl: string
|
||||
}): Promise<{ jobId: string }> {
|
||||
const res = await fetch(`${INGESTION_URL}/ingest`, {
|
||||
method: 'POST',
|
||||
body: formData,
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(payload),
|
||||
})
|
||||
return handleResponse<{ jobId: string }>(res)
|
||||
}
|
||||
|
||||
export async function getIngestionStatus(jobId: string): Promise<IngestionJobStatus> {
|
||||
const res = await fetch(`${INGESTION_URL}/ingest/${encodeURIComponent(jobId)}/status`)
|
||||
const res = await fetch(`${INGESTION_URL}/ingest/status/${encodeURIComponent(jobId)}`)
|
||||
return handleResponse<IngestionJobStatus>(res)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user