@soleil-se/app-util 5.4.0 → 5.4.1
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 +4 -0
- package/README.md +3 -0
- package/client/fetch-json/index.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [5.4.1] - 2023-08-22
|
|
9
|
+
|
|
10
|
+
- Add `/edit-app-config` to ignored URI:s in `fetchJson`.
|
|
11
|
+
|
|
8
12
|
## [5.4.0] - 2023-08-09
|
|
9
13
|
|
|
10
14
|
- Add `fetchJson` function to make requests to app routes or other resources.
|
package/README.md
CHANGED
|
@@ -230,6 +230,9 @@ Fetch wrapper for calling app routes, rest-api or external resources.
|
|
|
230
230
|
**Returns**: `Promise<Object>` - Promise containing parsed JSON-data.
|
|
231
231
|
**Throws** `Error` - Extended error object with custom properties for `status`, `aborted` and other JSON-data returned by the request.
|
|
232
232
|
|
|
233
|
+
URI:s starting with `/rest-api`, `/appresource`, `/edit-app-config` or a protocol, for example `https://` will be left as is.
|
|
234
|
+
Other URI:s will be converted to match a route in the current app with `getRouteUri`.
|
|
235
|
+
|
|
233
236
|
Most common usage is getting data from a route in the current app.
|
|
234
237
|
|
|
235
238
|
```js
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getRouteUri, stringifyParams } from '../../common';
|
|
2
2
|
|
|
3
3
|
function getUrl(uri, params) {
|
|
4
|
-
if (uri.startsWith('/rest-api') || uri.startsWith('/appresource') || !uri.startsWith('/')) {
|
|
4
|
+
if (uri.startsWith('/rest-api') || uri.startsWith('/appresource') || uri.startsWith('/edit-app-config') || !uri.startsWith('/')) {
|
|
5
5
|
return uri + stringifyParams(params, { addQueryPrefix: true });
|
|
6
6
|
}
|
|
7
7
|
return getRouteUri(uri, params);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soleil-se/app-util",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.1",
|
|
4
4
|
"description": "Utility and rendering functions for WebApps.",
|
|
5
5
|
"main": "./common/index.js",
|
|
6
6
|
"author": "Soleil AB",
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"@sitevision/api": "*"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "e95307bdefd374f4f325b6619430b2135c9334e2",
|
|
18
18
|
"dependencies": {}
|
|
19
19
|
}
|