Bugfix: UniverseDataService stub's update() method sends raw data to...
Documentation for Sessions
🐛 Bugfix: UniverseDataService stub's update() method sends raw data to...
Date: 2026-03-23
Time: 13:54:03 UTC
Session: gspace1-251.9
Agent: backend
Confidence: 97%
Status: ✅ Documented
📋 Decision Context
Question:
UniverseDataService stub's update() method sends raw data to backend PUT endpoint, but backend expects { data: {...} } wrapper. Also query() returns { data, total } but useCrudList reads { items, totalItems }.
Task: Not specified
🎯 Decision Made
Chosen:
Fixed update() to wrap body as { data }. Fixed query() to return BOTH field name conventions: { items, data, totalItems, total } so both useCrudList and manual service consumers work.
Options Considered:
- Fix only update() wrapping
- Fix only query() response mapping
- Fix both with dual-mapping for query (chosen)
💭 Reasoning
Backend data.controller.ts line 301 does $set: { ...body.data }, expecting data to be nested. The stub sent raw object, so body.data was undefined and all user fields were silently dropped — only updatedAt was set. For query(), the dual-mapping approach is correct because the generated API services do map(res => ({ items: res.data, totalItems: res.total })) while useCrudList reads result.items directly. Both paths must work.
📁 Files Involved
libs/libs-structural/platform-preview/src/lib/config/sdk-preview-stubs.tsAPIs/backend-api/src/app/data/data.controller.ts
🔗 Related
- Decision ID:
dev_1774274043708_kdsd7xj - Session: 251
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation