Skip to content

Commit

Permalink
clear
Browse files Browse the repository at this point in the history
  • Loading branch information
Iryna-Vyshniak committed Aug 29, 2023
1 parent 79f394d commit 49d5d47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions src/app/PixabayAPI.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import axios from 'axios';

axios.defaults.baseURL = 'https://pixabay.com/api/';
// axios.defaults.headers.common['Authorization'] = 'Client-ID 28194821-49041d995ecd04735d9e20d11';
const API_KEY = '28194821-49041d995ecd04735d9e20d11';

export class PixabayAPI {
Expand All @@ -24,7 +23,7 @@ export class PixabayAPI {
// const urlAXIOS = `?key=${API_KEY}&q=${this.#query}&page=${this.#page}&per_page=${this.#per_page}`;

const { data } = await axios.get(urlAXIOS, { params });
console.log('data: ', data);
// console.log('data: ', data);
return data;
}

Expand All @@ -50,9 +49,9 @@ export class PixabayAPI {
}

hasMorePhotos() {
console.log('page', this.#page);
console.log('totalPhotos', this.#totalPhotos);
console.log('per_page', this.#per_page);
// console.log('page', this.#page);
// console.log('totalPhotos', this.#totalPhotos);
// console.log('per_page', this.#per_page);
return this.#page < Math.ceil(this.#totalPhotos / this.#per_page);
}
}
6 changes: 3 additions & 3 deletions src/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ const onSubmitClick = async event => {

try {
spinnerPlay();
const { hits, total, totalHits } = await pixaby.getPhotos();
console.log('hits: ', hits);
console.log('total: ', total);
const { hits, totalHits } = await pixaby.getPhotos();
// console.log("totalHits: ", totalHits);
// console.log('hits: ', hits);

if (hits.length === 0) {
Notify.failure(
Expand Down

0 comments on commit 49d5d47

Please sign in to comment.