diff --git a/src/main.js b/src/main.js index 5d5964e..fb5c7bc 100644 --- a/src/main.js +++ b/src/main.js @@ -24,10 +24,10 @@ const pointsModel = new PointsModel({ const offersModel = new OffersModel({ offersApi: new OffersApi(END_POINT, AUTHORIZATION) }); -const filterModel = new FilterModel(); const destinationsModel = new DestinationsModel({ destinationsApi: new DestinationsApi(END_POINT, AUTHORIZATION) }); +const filterModel = new FilterModel(); const tripEventsPresenter = new TripEventsPresenter({ tpipEventsContainer : tripEvents, @@ -59,8 +59,9 @@ function handleNewPointButtonClick() { } render(newPointButtonComponent, mainContainer); -offersModel.init(); + destinationsModel.init(); +offersModel.init(); +pointsModel.init(); filterPresenter.init(); tripEventsPresenter.init(); -pointsModel.init(); diff --git a/src/model/points-model.js b/src/model/points-model.js index 37340ca..34ba6f0 100644 --- a/src/model/points-model.js +++ b/src/model/points-model.js @@ -80,13 +80,13 @@ export default class PointsModel extends Observable { basePrice: point['base_price'], dateFrom: new Date(point['date_from']), dateTo: new Date(point['date_to']), - isFavorite: point['is-favorite'] + isFavorite: point['is_favorite'] }; delete adaptedPoint['base_price']; delete adaptedPoint['date_from']; delete adaptedPoint['date_to']; - delete adaptedPoint['is-favorite']; + delete adaptedPoint['is_favorite']; return adaptedPoint; } diff --git a/src/presenter/trip-events-presenter.js b/src/presenter/trip-events-presenter.js index 773f247..f85bfde 100644 --- a/src/presenter/trip-events-presenter.js +++ b/src/presenter/trip-events-presenter.js @@ -141,10 +141,10 @@ export default class TripEventsPresenter { return; } - this.#renderTripInfo(); this.#renderSort(); this.#renderList(); this.#renderPoints(this.points); + this.#renderTripInfo(); } #clearBoard(resetSortType = false) {