ywana-core8 0.0.282 → 0.0.285
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 +12 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +12 -10
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +12 -10
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +7 -8
package/package.json
CHANGED
@@ -9,18 +9,15 @@ import { CreateContentDialog } from './CreateContentDialog_old'
|
|
9
9
|
import { SiteContext } from '../site/siteContext'
|
10
10
|
import "./CollectionPage.css"
|
11
11
|
|
12
|
-
|
13
|
-
const http = HTTPClient(window.API || process.env.REACT_APP_API, Session);
|
14
|
-
|
15
12
|
/**
|
16
13
|
* Collection Page
|
17
14
|
*/
|
18
15
|
export const CollectionPage = (props) => {
|
19
16
|
|
20
17
|
const site = useContext(SiteContext)
|
21
|
-
const { id = "collection", icon, title, name = "Collection 1", schema, url, groupBy, editor, field, autosave = false, delay = 1000, actions, levels, onSelect } = props
|
18
|
+
const { id = "collection", icon, title, name = "Collection 1", schema, url, host, groupBy, editor, field, autosave = false, delay = 1000, actions, levels, onSelect } = props
|
22
19
|
const [pageContext, setPageContext] = useContext(PageContext)
|
23
|
-
const context = CollectionContext(url, field)
|
20
|
+
const context = CollectionContext(url, field, host)
|
24
21
|
|
25
22
|
useEffect(async () => {
|
26
23
|
await context.load()
|
@@ -239,9 +236,9 @@ const CollectionEditor = (props) => {
|
|
239
236
|
/**
|
240
237
|
* Collection Context
|
241
238
|
*/
|
242
|
-
export const CollectionContext = (url, field) => {
|
239
|
+
export const CollectionContext = (url, field, host) => {
|
243
240
|
|
244
|
-
const API = CollectionAPI(url)
|
241
|
+
const API = CollectionAPI(url, host)
|
245
242
|
|
246
243
|
return {
|
247
244
|
|
@@ -322,7 +319,9 @@ export const CollectionContext = (url, field) => {
|
|
322
319
|
/**
|
323
320
|
* Collection API
|
324
321
|
*/
|
325
|
-
const CollectionAPI = (url) => {
|
322
|
+
const CollectionAPI = (url, host) => {
|
323
|
+
|
324
|
+
const http = HTTPClient(host || window.API || process.env.REACT_APP_API, Session);
|
326
325
|
|
327
326
|
return {
|
328
327
|
all(filters) {
|