Compare commits

...

1 Commits

Author SHA1 Message Date
Cameron Pak 5ea40093a6 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>
2026-03-17 16:20:45 -05:00
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -16,6 +16,11 @@ export type BkndAdminConfig = {
* @default `/` * @default `/`
*/ */
basepath?: string; basepath?: string;
/**
* Sub-path for the Admin UI within the base path
* @default ``
*/
admin_basepath?: string;
/** /**
* Path to return to when clicking the logo * Path to return to when clicking the logo
* @default `/` * @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 = { const state = {
...options?.state, ...options?.state,
referrer: location, referrer: location,