Bugfix: useCrudList stub's requestDelete() calls deleteFn(id) with a...

Documentation for Sessions

🐛 Bugfix: useCrudList stub's requestDelete() calls deleteFn(id) with a...

Date: 2026-03-23
Time: 13:53:15 UTC
Session: gspace1-251.6
Agent: angular
Confidence: 99%
Status: ✅ Documented


📋 Decision Context

Question:

useCrudList stub's requestDelete() calls deleteFn(id) with a single string, but the real useCrudList API and all generated code expect deleteFn(ids: string[]) — an array. Causes TypeError: Cannot read properties of undefined (reading 'map').

Task: Not specified


🎯 Decision Made

Chosen:

Changed stub to call config.deleteFn([id]) wrapping single ID in array. Also fixed requestBulkDelete to pass full IDs array directly to deleteFn instead of calling per-item.

Options Considered:

  1. Change generated code to accept single ID
  2. Change stub to pass array (chosen — matches real API)

💭 Reasoning

The real useCrudList in libs/core/module-base/src/lib/crud/composables/use-crud-list.ts defines deleteFn?: (ids: string[]) => Observable and its requestDelete(id) wraps: confirmAndDelete([id]). The generated code's deleteFn does forkJoin(ids.map(id => this.api.delete(id))) which crashes when ids is a string. The stub must match the real contract exactly.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation