@emeryld/rrroutes-client 2.4.4 → 2.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +13 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +13 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -149,6 +149,7 @@ function toArgsTuple(args) {
|
|
|
149
149
|
function buildUrl(leaf, baseUrl, params, query) {
|
|
150
150
|
const normalizedParams = leaf.cfg.paramsSchema ? (0, import_rrroutes_contract.lowProfileParse)(leaf.cfg.paramsSchema, params) : {};
|
|
151
151
|
const normalizedQuery = leaf.cfg.querySchema ? (0, import_rrroutes_contract.lowProfileParse)(leaf.cfg.querySchema, query) : {};
|
|
152
|
+
console.log("buildUrl", { query, normalizedQuery });
|
|
152
153
|
const path = (0, import_rrroutes_contract.compilePath)(
|
|
153
154
|
leaf.path,
|
|
154
155
|
normalizedParams ?? {}
|
|
@@ -277,7 +278,10 @@ function buildGetLeaf(leaf, rqOpts, env) {
|
|
|
277
278
|
const fetchEndpoint = async (tuple, options) => {
|
|
278
279
|
const a = extractArgs(tuple);
|
|
279
280
|
const params = a?.params;
|
|
280
|
-
const query =
|
|
281
|
+
const query = {
|
|
282
|
+
...a?.query ?? {},
|
|
283
|
+
...options?.queryOverride ?? {}
|
|
284
|
+
};
|
|
281
285
|
const { url, normalizedQuery, normalizedParams } = buildUrl(
|
|
282
286
|
{ ...leaf, cfg: leafCfg },
|
|
283
287
|
baseUrl,
|
|
@@ -537,7 +541,10 @@ function buildInfiniteGetLeaf(leaf, rqOpts, env) {
|
|
|
537
541
|
const fetchEndpoint = async (tuple, options) => {
|
|
538
542
|
const a = extractArgs(tuple);
|
|
539
543
|
const params = a?.params;
|
|
540
|
-
const query =
|
|
544
|
+
const query = {
|
|
545
|
+
...a?.query ?? {},
|
|
546
|
+
...options?.queryOverride ?? {}
|
|
547
|
+
};
|
|
541
548
|
const { url, normalizedQuery, normalizedParams } = buildUrl(
|
|
542
549
|
{ ...leaf, cfg: leafCfg },
|
|
543
550
|
baseUrl,
|
|
@@ -832,7 +839,10 @@ function buildMutationLeaf(leaf, rqOpts, env) {
|
|
|
832
839
|
const fetchEndpoint = async (tuple, options) => {
|
|
833
840
|
const a = extractArgs(tuple);
|
|
834
841
|
const params = a?.params;
|
|
835
|
-
const query =
|
|
842
|
+
const query = {
|
|
843
|
+
...a?.query ?? {},
|
|
844
|
+
...options?.queryOverride ?? {}
|
|
845
|
+
};
|
|
836
846
|
const { url, normalizedQuery, normalizedParams } = buildUrl(
|
|
837
847
|
{ ...leaf, cfg: leafCfg },
|
|
838
848
|
baseUrl,
|