Skip to content

fix(stock-adjustment-draft): report save failures and show description - #177

Merged
snehar-nd merged 1 commit into
angular-zard-migrationfrom
fix/stock-adjustment-draft-save-feedback
Sep 23, 2026
Merged

snehar-nd merged 1 commit into
angular-zard-migrationfrom
fix/stock-adjustment-draft-save-feedback

Conversation

@gkbishnoi07

Copy link
Copy Markdown

Addresses the frontend defects behind: "Under Main Store → Stock Adjustment, drafts are saved successfully, but the saved draft records are not displayed under Previous Draft Records ('No records found'). Same in Sub-Store."

Investigation

The Previous-Draft-Records list mapping is correct (filteredStockAdjustmentList.data = response.data — the right AMRIT envelope, verified byte-identical to the pre-migration app; it even fixed the original's broken facility param). So when a draft genuinely saved, "No records found" means the backend returned an empty data array — a backend/no-data matter, not a list bug.

But two real frontend defects can make a draft appear saved yet be missing:

  1. False success on a failed save. submitStockAdjustmentDraft() showed "saved successfully" inside the subscribe without checking response.statusCode, so a failed save was reported as success — the draft never persisted and so never appears in the list. Fixed: if statusCode !== 200, show the error and stop.
  2. Blank Description column. The draft list bound adjustment?.draftDescription, but the field is draftDesc everywhere else — so the Description column was always empty. Fixed the binding.

Note

The default date range on the Previous-Draft-Records page is "today only" (plus a timezone shift), which could also hide a just-saved draft at day boundaries — flagging separately as a possible follow-up; not changed here.

two defects behind 'draft saved but not shown in Previous Draft Records':
- submitStockAdjustmentDraft showed 'saved successfully' without checking
  response.statusCode, so a failed save looked successful and the draft was
  never persisted. alert the error and stop instead.
- the draft list bound adjustment?.draftDescription but the field is
  draftDesc, so the Description column was always blank. fix the binding.
(the empty list itself, when the save truly succeeds, is a backend/no-data
matter — the list mapping is correct.)
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: a06f9baf-b901-49a6-93f3-1c3a38926622

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@snehar-nd
snehar-nd merged commit ba57b6f into angular-zard-migration Sep 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants