diff --git a/src/components/City.vue b/src/components/City.vue index 7414252..170ce1e 100644 --- a/src/components/City.vue +++ b/src/components/City.vue @@ -28,7 +28,7 @@ import axios from "axios"; @Component export default class City extends Vue { - @Prop({ required: true }) private readonly id!: number; + @Prop({ required: true }) private readonly city!: any; private created() { this.getCurrentData(); @@ -39,7 +39,7 @@ export default class City extends Vue { axios .get("https://api.openweathermap.org/data/2.5/weather", { params: { - id: this.id, + id: this.city.id, units: "metric", lang: "pl", appid: process.env.VUE_APP_OWM_API_KEY, @@ -57,7 +57,7 @@ export default class City extends Vue { axios .get("https://api.openweathermap.org/data/2.5/forecast", { params: { - id: this.id, + id: this.city.id, units: "metric", lang: "pl", appid: process.env.VUE_APP_OWM_API_KEY, diff --git a/src/components/NewCity.vue b/src/components/NewCity.vue new file mode 100644 index 0000000..11b37fc --- /dev/null +++ b/src/components/NewCity.vue @@ -0,0 +1,112 @@ + + + \ No newline at end of file diff --git a/src/views/Forecast.vue b/src/views/Forecast.vue index 0388bdf..29d032e 100644 --- a/src/views/Forecast.vue +++ b/src/views/Forecast.vue @@ -1,17 +1,45 @@