Updates
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import path from "path";
|
||||
import {
|
||||
APIResponseObject,
|
||||
ClientCrudFetchParams,
|
||||
@@ -24,16 +23,18 @@ export default async function clientCrudFetch<
|
||||
try {
|
||||
let pathname = basePath || ``;
|
||||
|
||||
pathname = path.join(pathname, String(table));
|
||||
pathname += `/${String(table)}`;
|
||||
|
||||
if (targetId) {
|
||||
pathname = path.join(pathname, String(targetId));
|
||||
pathname += `/${String(targetId)}`;
|
||||
}
|
||||
|
||||
if (query) {
|
||||
pathname = `${pathname}${serializeQuery(query)}`;
|
||||
}
|
||||
|
||||
pathname = pathname.replace(/\/{2,}/g, "/");
|
||||
|
||||
pathname = apiOrigin
|
||||
? `${apiOrigin}/${pathname}`.replace(/([^:]\/)\/+/g, "$1")
|
||||
: pathname;
|
||||
|
||||
Reference in New Issue
Block a user