ywana-core8 0.0.282 → 0.0.283
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 +8 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +8 -7
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +8 -7
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +6 -7
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
|
|
@@ -324,6 +321,8 @@ export const CollectionContext = (url, field) => {
|
|
324
321
|
*/
|
325
322
|
const CollectionAPI = (url) => {
|
326
323
|
|
324
|
+
const http = HTTPClient(host || window.API || process.env.REACT_APP_API, Session);
|
325
|
+
|
327
326
|
return {
|
328
327
|
all(filters) {
|
329
328
|
let queryParams = "?"
|