fix(webapp): normalize api path

This commit is contained in:
Ahmed Bouhuolia
2026-02-01 18:05:51 +02:00
parent d5bf56e333
commit 02be959461
3 changed files with 22 additions and 14 deletions

View File

@@ -13,6 +13,9 @@ import jsCookie from 'js-cookie';
import { deepMapKeys } from './map-key-deep';
export * from './deep';
/** Strips leading slash from a path segment to avoid double slashes when joining with a base (e.g. `/api/` + path). */
export const normalizeApiPath = (path) => (path || '').replace(/^\//, '');
export const getCookie = (name, defaultValue) =>
_.defaultTo(jsCookie.get(name), defaultValue);