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,11 +137,10 @@ export default {
137137 },
138138 })
139139 .then ((response ) => {
140- const items = this .mapDataResponse (response .data .data );
141- const total = response .data .meta .total ;
140+ const axiosData = response .data ;
142141 resolve ({
143- items,
144- total,
142+ items: this . mapDataResponse ( axiosData . data ) ,
143+ total: axiosData . meta ,
145144 });
146145 }).catch (() => reject ());
147146
@@ -151,9 +150,8 @@ export default {
151150 return new Promise ((resolve ) => {
152151 axios .get ((this .showResourceUri || this .resourceUri ) + ' /' + id)
153152 .then ((response ) => {
154- let item = response .data .data ;
155153 resolve ({
156- item,
154+ item: response . data . data ,
157155 });
158156 });
159157
@@ -219,14 +217,11 @@ export default {
219217 deleteEvent (ids ) {
220218 return new Promise ((resolve , reject ) => {
221219 const promises = [];
222- ids .forEach ((id ) => {
223- promises .push (this .deleteHandler (id));
224- });
225-
226- Promise .all (promises).then (() => {
227- resolve ();
228- }).catch (() => reject ());
220+ ids .forEach (id => promises .push (this .deleteHandler (id)));
229221
222+ Promise .all (promises)
223+ .then (() => resolve ())
224+ .catch (() => reject ());
230225 });
231226 },
232227 /**
You can’t perform that action at this time.
0 commit comments