A PR review is needed for a small contact quick search panel.
Stack and environment:
Functional requirements:
trim().POST /api/contacts/select with { id: number }.saved only if the API returned { ok: true }; for { ok: false } or an error, error must be shown.API contract:
GET /api/contacts?q=<string> -> { items: Array<{ id: number; name: string }> }POST /api/contacts/select with JSON { id: number } -> { ok: boolean }How to reproduce the issues in the current PR:
anna — results appear.Select.{ ok: false }, observation: the status still becomes saved, even though success is not confirmed by the contract.Assumptions:
HttpClient and are canceled on unsubscribe.Node.js 20.x, Angular CLI 20.x, browser dev server ng serve, standalone bootstrap, OnPush, Zone.js enabled.
Use line comments to explain the problem, its impact, the fix and how to test it.