Skip to content

Commit 201678b

Browse files
author
aafomin
committed
add unsetCity in weather
1 parent 3070258 commit 201678b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/store/weatherStore.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ export default {
1919
state.items = payload;
2020
state.searchLoading = false;
2121
},
22+
UNSET_ITEM_CITY(state) {
23+
state.items = [];
24+
},
2225
UNSET_CITY(state, payload) {
2326
state.cities = payload;
2427
},
@@ -130,6 +133,7 @@ export default {
130133
},
131134
SEARCH_CITY({ commit }, payload) {
132135
commit("SET_SEARCHLOADING", true);
136+
commit("UNSET_ITEM_CITY");
133137
let url = `https://dataservice.accuweather.com/locations/v1/cities/autocomplete?apikey=${
134138
key.weather
135139
}&q=${payload.searchText}&language=ru-ru`;

0 commit comments

Comments
 (0)