Add user authentication with login/signup/protected routes, boss pokemon detail fields and result team tracking, moves and abilities selector components and API, run ownership and visibility controls, and various UI improvements across encounters, run list, and journal pages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
35 lines
1020 B
TypeScript
35 lines
1020 B
TypeScript
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}`)
|
|
}
|