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:

  1. Fix only update() wrapping
  2. Fix only query() response mapping
  3. 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


🔗 Related


Auto-generated by MCP Smart Consolidation