vtb-appit 0.0.13 → 0.0.16
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 +6 -6
- package/package.json +1 -1
package/appit.js
CHANGED
|
@@ -56,6 +56,8 @@ class Appit {
|
|
|
56
56
|
await this.accommodations();
|
|
57
57
|
await this.schemes();
|
|
58
58
|
|
|
59
|
+
this.history.updatedAt = new Date().getTime();
|
|
60
|
+
|
|
59
61
|
fs.writeFileSync(this.historyPath, JSON.stringify(this.history));
|
|
60
62
|
|
|
61
63
|
return true;
|
|
@@ -98,14 +100,13 @@ class Appit {
|
|
|
98
100
|
const formattedPlaces = await this.formatPlaces(places);
|
|
99
101
|
for(let i = 0; i < formattedPlaces.length; i++) {
|
|
100
102
|
let formattedPlace = this.clean(JSON.parse(JSON.stringify(formattedPlaces[i])));
|
|
101
|
-
let labels = this.getLabels(formattedPlaces[i]);
|
|
102
103
|
|
|
103
104
|
let id = this.findId('places', formattedPlaces[i].object_id);
|
|
104
105
|
if(!id) {
|
|
105
|
-
let model = await this.createPlace({...formattedPlace,
|
|
106
|
+
let model = await this.createPlace({...formattedPlace, excursion_id: this.history.excursionId});
|
|
106
107
|
this.history.places[formattedPlaces[i].object_id] = model.data.id;
|
|
107
108
|
} else {
|
|
108
|
-
await this.updatePlace(id, {...formattedPlace,
|
|
109
|
+
await this.updatePlace(id, {...formattedPlace, excursion_id: this.history.excursionId});
|
|
109
110
|
}
|
|
110
111
|
}
|
|
111
112
|
}
|
|
@@ -175,6 +176,7 @@ class Appit {
|
|
|
175
176
|
if(accommodation.images && accommodation.images.length) {
|
|
176
177
|
accommodation.images = await this.mediaToBase64(accommodation.images);
|
|
177
178
|
}
|
|
179
|
+
console.log('accommodation', accommodation);
|
|
178
180
|
|
|
179
181
|
let id = this.findId('accommodations', accommodations[i].object_id);
|
|
180
182
|
if(!id) {
|
|
@@ -224,7 +226,7 @@ class Appit {
|
|
|
224
226
|
|
|
225
227
|
if(places[i].media.length)
|
|
226
228
|
images = await this.getImages(places[i].media, 'original/lg');
|
|
227
|
-
|
|
229
|
+
|
|
228
230
|
result.push({
|
|
229
231
|
title : places[i].title,
|
|
230
232
|
content : places[i].additionalText,
|
|
@@ -238,8 +240,6 @@ class Appit {
|
|
|
238
240
|
});
|
|
239
241
|
};
|
|
240
242
|
|
|
241
|
-
console.log(result);
|
|
242
|
-
|
|
243
243
|
return result;
|
|
244
244
|
}
|
|
245
245
|
|