feat(api): world/system/crew snapshots expose the active + pending task queue (#44)
This commit is contained in:
@@ -17,7 +17,7 @@ import { ShipSystemsPanel } from '@/components/ship-systems'
|
||||
import { SkillTreePanel } from '@/components/skill-tree'
|
||||
import { WorldMapPanel } from '@/components/world-map'
|
||||
import { CREW_CAPACITY } from '@/lib/game/ship-costs'
|
||||
import type { CrewDto, SystemState } from '@/lib/game/save'
|
||||
import type { CrewState, SystemState } from '@/lib/game/save'
|
||||
import type { ShipState } from '@/lib/game/ship'
|
||||
import type { TechDto } from '@/lib/game/tech'
|
||||
import pkg from '@/package.json'
|
||||
@@ -94,10 +94,10 @@ export function MissionControl() {
|
||||
fetch('/api/crew')
|
||||
.then(async (res) => {
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
||||
return (await res.json()) as CrewDto[]
|
||||
return (await res.json()) as CrewState // { crew, tasks } — the endpoint wraps the roster (JC-7)
|
||||
})
|
||||
.then((c) => {
|
||||
if (!cancelled) setCrewCount(c.length)
|
||||
if (!cancelled) setCrewCount(c.crew.length)
|
||||
})
|
||||
.catch(() => {})
|
||||
return () => {
|
||||
|
||||
Reference in New Issue
Block a user