Skip to content

fix: correct isArchived to is_archived in ViewCampaign.vue#431

Open
MuraariK13052008 wants to merge 1 commit intohatnote:masterfrom
MuraariK13052008:fix/bug-02-is-archived-case
Open

fix: correct isArchived to is_archived in ViewCampaign.vue#431
MuraariK13052008 wants to merge 1 commit intohatnote:masterfrom
MuraariK13052008:fix/bug-02-is-archived-case

Conversation

@MuraariK13052008
Copy link
Copy Markdown

What this fixes

Two broken behaviours in the campaign view:

  • The "Add Round" button was never disabled on archived campaigns
  • The "Cancel" button in campaign edit mode always showed, even on archived campaigns

Root cause

Lines 44 and 75 of ViewCampaign.vue use campaign.isArchived (camelCase). The API returns is_archived (snake_case). Looking up a camelCase key on a plain JS object returns undefined, which is falsy. So:

  • :disabled="campaign.isArchived" → always false → button always enabled
  • v-if="!campaign.isArchived" → always true → Cancel always visible

Fix

Changed both occurrences from campaign.isArchivedcampaign.is_archived.

Files changed

  • frontend/src/components/Campaign/ViewCampaign.vue

How to verify

  1. Archive any campaign
  2. Open the campaign — confirm "Add Round" button is now disabled
  3. Enter edit mode — confirm "Cancel" button is no longer shown on archived campaigns

Relates to: T415578

The backend uses snake_case (is_archived), but the frontend
was using camelCase (isArchived), causing incorrect UI state.

Fixes: incorrect campaign archive status handling
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.

1 participant