vtb-appit 0.0.38 → 0.0.39
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/appit.js +5 -2
- package/package.json +1 -1
package/appit.js
CHANGED
|
@@ -206,12 +206,15 @@ class Appit {
|
|
|
206
206
|
let destination = this.clean(JSON.parse(JSON.stringify(destinations[i])));
|
|
207
207
|
let labels = this.getLabels(destinations[i]);
|
|
208
208
|
|
|
209
|
+
const images = (destination.images.length) ? await this.getImages(destination.images, 'original/lg') : {};
|
|
210
|
+
delete destination.images;
|
|
211
|
+
|
|
209
212
|
let id = this.findId('destinations', destinations[i].object_id);
|
|
210
213
|
if(!id) {
|
|
211
|
-
let model = await this.createDestination({...destination, labels: labels, excursion_id: this.history.excursionId});
|
|
214
|
+
let model = await this.createDestination({...destination, ...images, labels: labels, excursion_id: this.history.excursionId});
|
|
212
215
|
this.history.destinations[destinations[i].object_id] = model.data.id;
|
|
213
216
|
} else {
|
|
214
|
-
await this.updateDestination(id, {...destination, labels: labels, excursion_id: this.history.excursionId});
|
|
217
|
+
await this.updateDestination(id, {...destination, ...images, labels: labels, excursion_id: this.history.excursionId});
|
|
215
218
|
}
|
|
216
219
|
}
|
|
217
220
|
}
|