ywana-core8 0.0.438 → 0.0.441
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 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +8 -6
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +8 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +7 -7
- package/src/domain/ContentViewer.js +1 -0
package/package.json
CHANGED
@@ -15,9 +15,9 @@ import "./CollectionPage.css"
|
|
15
15
|
export const CollectionPage = (props) => {
|
16
16
|
|
17
17
|
const site = useContext(SiteContext)
|
18
|
-
const { id = "collection", icon, title, name = "Collection 1", schema, url, host, groupBy, editor, field, autosave = false, delay = 1000, actions, levels, onSelect, children } = props
|
18
|
+
const { id = "collection", icon, title, name = "Collection 1", schema, url, page, host, groupBy, editor, field, autosave = false, delay = 1000, actions, levels, onSelect, children } = props
|
19
19
|
const [pageContext, setPageContext] = useContext(PageContext)
|
20
|
-
const context = CollectionContext(url, field, host)
|
20
|
+
const context = CollectionContext(url, field, host, page)
|
21
21
|
|
22
22
|
useEffect(async () => {
|
23
23
|
await context.load()
|
@@ -237,7 +237,7 @@ const CollectionEditor = (props) => {
|
|
237
237
|
/**
|
238
238
|
* Collection Context
|
239
239
|
*/
|
240
|
-
export const CollectionContext = (url, field, host) => {
|
240
|
+
export const CollectionContext = (url, field, host, page) => {
|
241
241
|
|
242
242
|
const API = CollectionAPI(url, host)
|
243
243
|
|
@@ -248,7 +248,7 @@ export const CollectionContext = (url, field, host) => {
|
|
248
248
|
|
249
249
|
async load() {
|
250
250
|
try {
|
251
|
-
const data = await API.all();
|
251
|
+
const data = await API.all(null, page);
|
252
252
|
this.all = field ? data[field] : data;
|
253
253
|
} catch (error) {
|
254
254
|
console.log(error)
|
@@ -325,8 +325,8 @@ const CollectionAPI = (url, host) => {
|
|
325
325
|
const http = HTTPClient(host || window.API || process.env.REACT_APP_API, Session);
|
326
326
|
|
327
327
|
return {
|
328
|
-
all(filters) {
|
329
|
-
let queryParams = "?"
|
328
|
+
all(filters, page) {
|
329
|
+
let queryParams = page ? `?page=${page}&` : "?"
|
330
330
|
if (filters) {
|
331
331
|
const filterQuery = Object.keys(filters).reduce((query, key) => {
|
332
332
|
const value = filters[key]
|
@@ -344,7 +344,7 @@ const CollectionAPI = (url, host) => {
|
|
344
344
|
}, "")
|
345
345
|
queryParams = queryParams.concat(filterQuery)
|
346
346
|
}
|
347
|
-
return http.GET(url)
|
347
|
+
return http.GET(url + queryParams)
|
348
348
|
},
|
349
349
|
|
350
350
|
find(id) {
|