vue-laravel-crud 1.4.12 → 1.4.13

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": "vue-laravel-crud",
3
- "version": "1.4.12",
3
+ "version": "1.4.13",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/clonixdev/vue-laravel-crud",
6
6
  "main": "dist/vue-laravel-crud.ssr.js",
@@ -51,7 +51,10 @@
51
51
  "@vuex-orm/plugin-axios": "^0.9.4"
52
52
  },
53
53
  "peerDependencies": {
54
- "vue": "^2.7.14"
54
+ "vue": "^2.7.14",
55
+ "vuex": "^3.6.2",
56
+ "@vuex-orm/core": "^0.36.4",
57
+ "@vuex-orm/plugin-axios": "^0.9.4"
55
58
  },
56
59
  "engines": {
57
60
  "node": ">=14"
@@ -2,7 +2,6 @@
2
2
  import draggable from "vuedraggable";
3
3
  import axios from "axios";
4
4
  import moment from "moment";
5
- import { Model } from '@vuex-orm/core';
6
5
 
7
6
  export default /*#__PURE__*/ {
8
7
  name: "VueLaravelCrud",
@@ -58,7 +57,7 @@ export default /*#__PURE__*/ {
58
57
 
59
58
  title: String,
60
59
  model: {
61
- type: Object | Model,
60
+ type: Object | Function,
62
61
  default() {
63
62
  return { id: 0 };
64
63
  },
@@ -539,8 +538,19 @@ export default /*#__PURE__*/ {
539
538
  async fetchItemsVuex(page = 1) {
540
539
  this.loading = true;
541
540
  this.$emit("beforeFetch", {});
542
- this.collection = await this.model.api().query().offset(page).limit(this.pagination.perPage).get();
543
- console.debug("fetch page vuex ", page, this.collection);
541
+
542
+ const result = await this.model.api().get('', {
543
+ params: {
544
+ page: page,
545
+ limit: this.pagination.perPage,
546
+ filters: JSON.stringify(this.finalFilters),
547
+ }
548
+ });
549
+
550
+ this.collection = result.entities[this.model.entity];
551
+
552
+
553
+ console.debug("fetch page vuex ", page, this.collection);
544
554
  this.loading = false;
545
555
  },
546
556
  fetchItems(page = 1) {