Skip to content

Commit

Permalink
fix serch
Browse files Browse the repository at this point in the history
  • Loading branch information
Hahlina committed Apr 21, 2023
1 parent d293f91 commit 81f9782
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/utils/api.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
`use strict`
import {validForm} from "./validSearchCity.js";
import { validForm} from "./validSearchCity.js";
import {Loader} from "../components/Preloader/Preloader.js";

export async function fetchDataWeather(url){
Expand Down
3 changes: 1 addition & 2 deletions src/utils/setEventSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {fetchDataWeather} from "./api.js";
import {API_KEY, APP_LANGUAGE, BASE_URL} from "./constans.js";



export const setEventSearch = () => {
const formSearch = document.querySelector("form");
const searchIcon = document.querySelector(".searchIcon");
Expand All @@ -23,10 +24,8 @@ async function submit (form){
const nameCity = document.querySelector("input");
const inputBox = document.querySelector(".inputbox");
if (nameCity.value === "") {
inputBox.classList.add("fail");
return;
}

const URL = `${BASE_URL}${nameCity.value}&units=metric&${APP_LANGUAGE}&appid=${API_KEY}`;

form.reset();
Expand Down
2 changes: 1 addition & 1 deletion src/utils/validSearchCity.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export function validForm(){
inputBox.classList.remove("fail")
inputBox.querySelector("span").textContent = "City name"
})
}
}
3 changes: 0 additions & 3 deletions style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,6 @@ body {
max-width: fit-content;
width: 100vw;
height: 250px;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 20px;
@media screen and (min-width: 877px){
width: 100%;
Expand Down

0 comments on commit 81f9782

Please sign in to comment.