File tree Expand file tree Collapse file tree
generator/templates/Crud/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,9 +124,6 @@ export default {
124124 required: false ,
125125 },
126126 },
127- created () {
128- console .log (this .$attrs );
129- },
130127 methods: {
131128 /** *
132129 * @param pagination
@@ -135,13 +132,19 @@ export default {
135132 getDataFromApi (pagination , search ) {
136133 const {sortBy , sortDesc , page , itemsPerPage } = pagination;
137134 return new Promise ((resolve , reject ) => {
135+ let sorting = {};
136+ if (sortBy[0 ]) {
137+ sorting = {
138+ sortBy: sortBy[0 ],
139+ desc: sortDesc[0 ] ? 1 : 0 ,
140+ };
141+ }
138142 this .$http .get (this .resourceUri , {
139143 params: {
140144 q: search,
141- sortBy: sortBy[0 ],
142- desc: sortDesc[0 ] ? 1 : 0 ,
143145 page: page,
144146 perPage: itemsPerPage,
147+ ... sorting,
145148 },
146149 })
147150 .then ((response ) => {
You can’t perform that action at this time.
0 commit comments