mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-27 10:09:48 +00:00
fix(webapp): normalize api path
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user