|
|
@@ -10,7 +10,8 @@ export default class ContentAPI extends APIRepository {
|
|
|
byId: (id) => '/cma/contents/' + id
|
|
|
}
|
|
|
this.CacheList = {
|
|
|
- base: this.name + this.APIAdresses.base
|
|
|
+ base: this.name + this.APIAdresses.base,
|
|
|
+ index: (filters) => this.name + this.APIAdresses.base + encodeURI(filters)
|
|
|
}
|
|
|
this.restUrl = (id) => this.APIAdresses.base + '/' + id
|
|
|
/* Setting the callback functions for the CRUD operations. */
|
|
|
@@ -23,15 +24,17 @@ export default class ContentAPI extends APIRepository {
|
|
|
}
|
|
|
|
|
|
index(data) {
|
|
|
+ const normalizedSendData = this.getNormalizedSendData({
|
|
|
+ category: null, // Number
|
|
|
+ per_page: 10, // Number
|
|
|
+ page: 1 // Number
|
|
|
+ }, data)
|
|
|
return this.sendRequest({
|
|
|
apiMethod: 'get',
|
|
|
api: this.api,
|
|
|
request: this.APIAdresses.base,
|
|
|
- data: this.getNormalizedSendData({
|
|
|
- category: null, // Number
|
|
|
- per_page: 10, // Number
|
|
|
- page: 1 // Number
|
|
|
- }, data),
|
|
|
+ cacheKey: this.CacheList.index(normalizedSendData),
|
|
|
+ data: normalizedSendData,
|
|
|
resolveCallback: (response) => {
|
|
|
const paginate = response.data
|
|
|
const results = response.data.results
|