add Ko-fi bean
This commit is contained in:
37
frontend/src/api/journal.ts
Normal file
37
frontend/src/api/journal.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { api } from './client'
|
||||
import type {
|
||||
JournalEntry,
|
||||
CreateJournalEntryInput,
|
||||
UpdateJournalEntryInput,
|
||||
} from '../types/journal'
|
||||
|
||||
export function getJournalEntries(
|
||||
runId: number,
|
||||
bossResultId?: number
|
||||
): Promise<JournalEntry[]> {
|
||||
const params = bossResultId != null ? `?boss_result_id=${bossResultId}` : ''
|
||||
return api.get(`/runs/${runId}/journal${params}`)
|
||||
}
|
||||
|
||||
export function getJournalEntry(runId: number, entryId: string): Promise<JournalEntry> {
|
||||
return api.get(`/runs/${runId}/journal/${entryId}`)
|
||||
}
|
||||
|
||||
export function createJournalEntry(
|
||||
runId: number,
|
||||
data: CreateJournalEntryInput
|
||||
): Promise<JournalEntry> {
|
||||
return api.post(`/runs/${runId}/journal`, data)
|
||||
}
|
||||
|
||||
export function updateJournalEntry(
|
||||
runId: number,
|
||||
entryId: string,
|
||||
data: UpdateJournalEntryInput
|
||||
): Promise<JournalEntry> {
|
||||
return api.put(`/runs/${runId}/journal/${entryId}`, data)
|
||||
}
|
||||
|
||||
export function deleteJournalEntry(runId: number, entryId: string): Promise<void> {
|
||||
return api.del(`/runs/${runId}/journal/${entryId}`)
|
||||
}
|
||||
Reference in New Issue
Block a user