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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.282",
3
+ "version": "0.0.285",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -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) {