fix: include admin_basepath in absolute navigation paths

Fixes navigate(..., { absolute: true }) only prepending basepath but
missing admin_basepath, causing links like /data instead of /admin/data.

Adds admin_basepath to BkndAdminConfig type.

Amp-Thread-ID: https://ampcode.com/threads/T-019cfd9f-89ca-703c-a86c-99eef60e3fe8
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Cameron Pak
2026-03-17 16:20:45 -05:00
parent feb3911d46
commit 5ea40093a6
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -16,6 +16,11 @@ export type BkndAdminConfig = {
* @default `/`
*/
basepath?: string;
/**
* Sub-path for the Admin UI within the base path
* @default ``
*/
admin_basepath?: string;
/**
* Path to return to when clicking the logo
* @default `/`
+1 -1
View File
@@ -101,7 +101,7 @@ export function useNavigate() {
}
}
const _url = options?.absolute ? `~/${basepath}${url}`.replace(/\/+/g, "/") : url;
const _url = options?.absolute ? `~/${app.options.basepath}/${app.options.admin_basepath}${url}`.replace(/\/+/g, "/") : url;
const state = {
...options?.state,
referrer: location,