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 @@ -137,10 +137,11 @@ export default {
137137 },
138138 })
139139 .then ((response ) => {
140- const axiosData = response .data ;
140+ const items = this .mapDataResponse (response .data .data );
141+ const total = response .data .meta .total ;
141142 resolve ({
142- items: this . mapDataResponse ( axiosData . data ) ,
143- total: axiosData . meta ,
143+ items,
144+ total,
144145 });
145146 }).catch (() => reject ());
146147
@@ -150,8 +151,9 @@ export default {
150151 return new Promise ((resolve ) => {
151152 axios .get ((this .showResourceUri || this .resourceUri ) + ' /' + id)
152153 .then ((response ) => {
154+ let item = response .data .data ;
153155 resolve ({
154- item: response . data . data ,
156+ item,
155157 });
156158 });
157159
@@ -217,11 +219,14 @@ export default {
217219 deleteEvent (ids ) {
218220 return new Promise ((resolve , reject ) => {
219221 const promises = [];
220- ids .forEach (id => promises .push (this .deleteHandler (id)));
222+ ids .forEach ((id ) => {
223+ promises .push (this .deleteHandler (id));
224+ });
225+
226+ Promise .all (promises).then (() => {
227+ resolve ();
228+ }).catch (() => reject ());
221229
222- Promise .all (promises)
223- .then (() => resolve ())
224- .catch (() => reject ());
225230 });
226231 },
227232 /**
You can’t perform that action at this time.
0 commit comments