ywana-core8 0.0.911 → 0.0.912
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 +15 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +15 -6
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +15 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionAPI.js +11 -1
- package/src/domain/CollectionPage.js +4 -4
package/package.json
CHANGED
@@ -4,7 +4,7 @@ import { isEmpty} from '../commons'
|
|
4
4
|
/**
|
5
5
|
* Collection API
|
6
6
|
*/
|
7
|
-
export const CollectionAPI = (url, host) => {
|
7
|
+
export const CollectionAPI = (url, host, params) => {
|
8
8
|
|
9
9
|
const http = HTTPClient(host || window.API || process.env.REACT_APP_API, Session);
|
10
10
|
|
@@ -45,10 +45,20 @@ import { isEmpty} from '../commons'
|
|
45
45
|
return {
|
46
46
|
|
47
47
|
all(filters, likes = [], page) {
|
48
|
+
|
49
|
+
// build query params
|
48
50
|
let queryParams = page ? `?page=${page}&` : "?"
|
51
|
+
|
52
|
+
// concat optional params to queryparams
|
53
|
+
queryParams = `${queryParams}${params}`
|
54
|
+
|
55
|
+
// concat filters to queryparams
|
49
56
|
const filterQuery = objectToQueryParamString(filters, likes)
|
50
57
|
queryParams = `${queryParams}${filterQuery}`
|
58
|
+
|
59
|
+
// remove last &
|
51
60
|
queryParams = queryParams.substring(0, queryParams.length - 1)
|
61
|
+
|
52
62
|
return http.GET(`${url}${queryParams}`)
|
53
63
|
},
|
54
64
|
|
@@ -18,7 +18,7 @@ export const CollectionPage = (props) => {
|
|
18
18
|
const {
|
19
19
|
id = "collection",
|
20
20
|
icon, title, name = "Collection 1", className,
|
21
|
-
schema, url, field, host, page, fetching = false,
|
21
|
+
schema, url, field, host, page, fetching = false, params,
|
22
22
|
actions = [], onSelect, onChange,
|
23
23
|
canFilter = false, canAdd = false, canDelete = false, searchBy, addValidator,
|
24
24
|
autosave = false, delay = 1000, patch = false, versioning = false,
|
@@ -30,7 +30,7 @@ export const CollectionPage = (props) => {
|
|
30
30
|
children
|
31
31
|
} = props
|
32
32
|
|
33
|
-
const context = CollectionContext(url, field, host, page, fetching, versioning)
|
33
|
+
const context = CollectionContext(url, field, host, page, fetching, versioning, params)
|
34
34
|
const [pageContext, setPageContext] = useContext(PageContext)
|
35
35
|
const { all } = pageContext
|
36
36
|
|
@@ -460,9 +460,9 @@ const CollectionEditor = (props) => {
|
|
460
460
|
/**
|
461
461
|
* Collection Context
|
462
462
|
*/
|
463
|
-
export const CollectionContext = (url, field, host, page, fetching, versioning = false) => {
|
463
|
+
export const CollectionContext = (url, field, host, page, fetching, versioning = false, params) => {
|
464
464
|
|
465
|
-
const API = CollectionAPI(url, host)
|
465
|
+
const API = CollectionAPI(url, host, params)
|
466
466
|
|
467
467
|
return {
|
468
468
|
|