Skip to content

fix(groups): show API error messages on create and update - #6356

Open
Brisbanehuang wants to merge 1 commit into
Wei-Shaw:mainfrom
Brisbanehuang:fix/group-update-error-message
Open

fix(groups): show API error messages on create and update#6356
Brisbanehuang wants to merge 1 commit into
Wei-Shaw:mainfrom
Brisbanehuang:fix/group-update-error-message

Conversation

@Brisbanehuang

Copy link
Copy Markdown
Contributor

Summary

  • use the existing extractApiErrorMessage helper when group creation or update fails
  • surface standardized interceptor errors such as GROUP_EXISTS instead of the generic save failure message
  • add a regression test for duplicate names during group update

Why

The Axios interceptor rejects a plain object containing message and reason, while the group form only checked the legacy error.response.data.detail shape. This caused duplicate-name errors to be shown as a generic "Failed to update group" message.

Tests

  • pnpm vitest run src/views/admin/__tests__/GroupsView.duplicate.spec.ts
  • pnpm typecheck
  • pnpm eslint src/views/admin/GroupsView.vue src/views/admin/__tests__/GroupsView.duplicate.spec.ts

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