Skip to content

Commit 40d0ef8

Browse files
Update api.js
1 parent 25b9cbc commit 40d0ef8

File tree

1 file changed

+6
-8
lines changed
  • image-finder-app/src/Services

1 file changed

+6
-8
lines changed

image-finder-app/src/Services/api.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
import axios from 'axios';
1+
impimport axios from 'axios';
22

33
const API_KEY = "22506390-5f30c2369c48e6ce339972ea6";
44
const URL = "https://pixabay.com/api/"
55

66
export const getImages = (text, count) => {
7-
try{
8-
const data = axios.get(`${URL}?key=${API_KEY}&q=${text}&image_type=photo&per_page=${count}&safesearch=true`)
9-
return data;
10-
}catch(error){
7+
try {
8+
const data = axios.get(`${URL}?key=${API_KEY}&q=${text}&image_type=photo&per_page=${count}&safesearch=true`)
9+
return data;
10+
} catch (error) {
1111

12-
}
12+
}
1313
}
14-
15-

0 commit comments

Comments
 (0)