Files
nuzlocke-tracker/frontend/src/api/journal.ts
Julian Tabel 0a519e356e
Some checks failed
CI / backend-tests (push) Failing after 1m16s
CI / frontend-tests (push) Successful in 57s
feat: add auth system, boss pokemon details, moves/abilities API, and run ownership
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>
2026-03-20 21:41:38 +01:00

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}`)
}