eddev 2.0.0-beta.186 → 2.0.0-beta.187

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.
@@ -303,7 +303,7 @@ export class ServerContext {
303
303
  return headers;
304
304
  }
305
305
  async fetchNamedQuery(req) {
306
- const url = `/wp-json/ed/v1/query/${req.name}?params=${encodeURIComponent(JSON.stringify(req.params))}`;
306
+ const url = `/wp-json/ed/v1/query/${req.name.replace(/^\//, "")}?params=${encodeURIComponent(JSON.stringify(req.params))}`;
307
307
  const key = `fetchNamedQuery:${req.name}:${JSON.stringify(req.params)}`;
308
308
  const fetch = async () => {
309
309
  const result = await this.fetchOrigin(url, {
@@ -353,7 +353,7 @@ export class ServerContext {
353
353
  });
354
354
  }
355
355
  async fetchMutation(req) {
356
- const url = `/wp-json/ed/v1/mutation/${req.name}`;
356
+ const url = `/wp-json/ed/v1/mutation/${req.name.replace(/^\//, "")}`;
357
357
  return this.fetchOrigin(url, {
358
358
  method: "POST",
359
359
  cache: "no-cache",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "2.0.0-beta.186",
3
+ "version": "2.0.0-beta.187",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",