@fy-/fws-vue 0.3.72 → 0.3.74

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.
@@ -39,11 +39,18 @@ export function useRest(): <ResultType extends APIResult>(
39
39
  method: RestMethod,
40
40
  params?: RestParams,
41
41
  ): Promise<ResultType> => {
42
- const urlParse = new URL(url);
43
- const pathOnly = urlParse.pathname + urlParse.search;
42
+ let urlForHash: string = url;
43
+ try {
44
+ const urlParse = new URL(url);
45
+ urlForHash = urlParse.pathname + urlParse.search;
46
+ } catch (error) {
47
+ urlForHash = url;
48
+ }
44
49
 
45
- const requestHash = stringHash(pathOnly + method + JSON.stringify(params));
46
- if (getMode() !== "ssr") {
50
+ const requestHash = stringHash(
51
+ urlForHash + method + JSON.stringify(params),
52
+ );
53
+ if (isServerRendered()) {
47
54
  const hasResult = restStore.getResult(requestHash);
48
55
  if (hasResult !== undefined) {
49
56
  const result = hasResult as ResultType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "0.3.72",
3
+ "version": "0.3.74",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "repository": {