fix(app): resolve Bucket E.1 — switch to named isAxiosError import
WS-3 session 1b-ii Task 5a (audit Bucket E.1 — 2 items).
EventTabsNav.vue:
- Replaced \`import axios from 'axios'\` with
\`import { isAxiosError } from 'axios'\` (no other axios.* usage in
the file).
- Updated both call sites: \`axios.isAxiosError(...)\` → \`isAxiosError(...)\`
on lines 53 and 76.
Modern axios pattern; resolves the import/no-named-as-default-member
warnings flagged in the WS-3 1b-i audit. No behaviour change — the
named export is the same function.
Note: this commit is split out from the originally-planned grouped
Task 5 commit because the API stream timed out mid-task. E.2-E.5
follow in subsequent commits.
Tests + typecheck verified green.
Lint baseline: 36 → 34.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import axios from 'axios'
|
||||
import { isAxiosError } from 'axios'
|
||||
import { useEventChildren, useEventDetail, useTransitionEventStatus } from '@/composables/api/useEvents'
|
||||
import { dutchPlural } from '@/lib/dutch-plural'
|
||||
import { eventStatusLabelNl, transitionVisualKind } from '@/lib/event-status'
|
||||
@@ -50,7 +50,7 @@ function cancelTransitionConfirm() {
|
||||
}
|
||||
|
||||
function transition422Message(err: unknown): string {
|
||||
if (!axios.isAxiosError(err))
|
||||
if (!isAxiosError(err))
|
||||
return ''
|
||||
|
||||
const body = err.response?.data as { message?: string; errors?: string[] } | undefined
|
||||
@@ -73,7 +73,7 @@ async function confirmTransition() {
|
||||
cancelTransitionConfirm()
|
||||
}
|
||||
catch (err) {
|
||||
if (axios.isAxiosError(err) && err.response?.status === 422) {
|
||||
if (isAxiosError(err) && err.response?.status === 422) {
|
||||
const msg = transition422Message(err)
|
||||
|
||||
notificationStore.show(msg || 'Status wijzigen is op dit moment niet mogelijk.', 'error')
|
||||
|
||||
Reference in New Issue
Block a user