@akinon/next 1.42.0-rc.7 → 1.42.0-rc.9
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/CHANGELOG.md +8 -0
- package/components/input.tsx +1 -0
- package/components/price.tsx +1 -0
- package/package.json +2 -2
- package/utils/index.ts +21 -6
package/CHANGELOG.md
CHANGED
package/components/input.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import { forwardRef, FocusEvent, useState, Ref } from 'react';
|
|
3
3
|
import { Controller } from 'react-hook-form';
|
|
4
|
+
|
|
4
5
|
// @ts-ignore
|
|
5
6
|
import { PatternFormat, PatternFormatProps } from 'react-number-format';
|
|
6
7
|
import { InputProps } from '../types';
|
package/components/price.tsx
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/next",
|
|
3
3
|
"description": "Core package for Project Zero Next",
|
|
4
|
-
"version": "1.42.0-rc.
|
|
4
|
+
"version": "1.42.0-rc.9",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"set-cookie-parser": "2.6.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@akinon/eslint-plugin-projectzero": "1.42.0-rc.
|
|
33
|
+
"@akinon/eslint-plugin-projectzero": "1.42.0-rc.9",
|
|
34
34
|
"@types/react-redux": "7.1.30",
|
|
35
35
|
"@types/set-cookie-parser": "2.4.7",
|
|
36
36
|
"@typescript-eslint/eslint-plugin": "6.7.4",
|
package/utils/index.ts
CHANGED
|
@@ -63,18 +63,33 @@ export function getTranslateFn(path: string, translations: any) {
|
|
|
63
63
|
|
|
64
64
|
export function buildClientRequestUrl(
|
|
65
65
|
path: string,
|
|
66
|
-
options?: ClientRequestOptions
|
|
66
|
+
options?: ClientRequestOptions & { cache?: boolean }
|
|
67
67
|
) {
|
|
68
68
|
let url = `/api/client${path}`;
|
|
69
69
|
|
|
70
|
+
let hasQuery = url.includes('?');
|
|
71
|
+
|
|
70
72
|
if (options) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
const { cache, ...otherOptions } = options;
|
|
74
|
+
|
|
75
|
+
if (Object.keys(otherOptions).length > 0) {
|
|
76
|
+
if (hasQuery) {
|
|
77
|
+
url += '&';
|
|
78
|
+
} else {
|
|
79
|
+
url += '?';
|
|
80
|
+
hasQuery = true;
|
|
81
|
+
}
|
|
82
|
+
url += `options=${encodeURIComponent(JSON.stringify(otherOptions))}`;
|
|
75
83
|
}
|
|
76
84
|
|
|
77
|
-
|
|
85
|
+
if (cache === false) {
|
|
86
|
+
if (hasQuery) {
|
|
87
|
+
url += '&';
|
|
88
|
+
} else {
|
|
89
|
+
url += '?';
|
|
90
|
+
}
|
|
91
|
+
url += `t=${Date.now()}`;
|
|
92
|
+
}
|
|
78
93
|
}
|
|
79
94
|
|
|
80
95
|
return url;
|