Skip to content

Commit 3276311

Browse files
committed
Fix config
1 parent 9386e7f commit 3276311

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@westacks/vortex",
3-
"version": "0.0.18",
3+
"version": "0.0.19",
44
"license": "MIT",
55
"description": "Server-based routing for SPAs",
66
"author": "Dmytro Morozov <puny.flash@gmail.com>",

src/extensions/inertia.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { axios, getPage, setPage, type VortexExtension, type VortexConfig, type Page } from "../index";
22
import type { AxiosError, AxiosResponse } from "axios";
3-
import { RouterRequestConfig } from "../router";
3+
import { InternalRouterRequestConfig } from "../router";
44

55
declare module '../index' {
66
interface VortexConfig {
@@ -62,7 +62,9 @@ const inertia = (initialPage: Page): VortexExtension => {
6262
return request
6363
}),
6464
response: response.use(resolveResponse, function (error: AxiosError) {
65-
if (!(error.request?.config as RouterRequestConfig).vortex) {
65+
const config: InternalRouterRequestConfig = error.config as InternalRouterRequestConfig
66+
67+
if (!config?.vortex) {
6668
return Promise.reject(error)
6769
}
6870

0 commit comments

Comments
 (0)