vtb-appit 0.0.46 → 0.0.47
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-base-transformer.js +5 -0
- package/appit.js +11 -9
- package/package.json +1 -1
package/appit.js
CHANGED
|
@@ -153,15 +153,17 @@ class Appit {
|
|
|
153
153
|
async flightImages()
|
|
154
154
|
{
|
|
155
155
|
const object = this.transformer.flightImages();
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
156
|
+
if(object) {
|
|
157
|
+
const workObject = JSON.parse(JSON.stringify(object));
|
|
158
|
+
const images = (workObject.images.length) ? await this.getImages(workObject.images, 'original/lg') : {};
|
|
159
|
+
delete workObject.images;
|
|
160
|
+
delete workObject.object_id;
|
|
161
|
+
|
|
162
|
+
let id = this.findId('flightImages', object.object_id);
|
|
163
|
+
if(!id) {
|
|
164
|
+
let model = await this.createFlightImage({...workObject, ...images, excursion_id: this.history.excursionId});
|
|
165
|
+
this.history.flightImages[object.object_id] = model.data.id;
|
|
166
|
+
}
|
|
165
167
|
}
|
|
166
168
|
}
|
|
167
169
|
|