Skip to content

Commit

Permalink
Merge pull request #1 from BekhUriy/api-requests
Browse files Browse the repository at this point in the history
Create api-requests.js
  • Loading branch information
BekhUriy authored Nov 10, 2023
2 parents 1f8e793 + f8de0ec commit 435c555
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/js/api-requests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import axios from 'axios';

export class API_SERVICE {
#BASE_URL = 'https://books-backend.p.goit.global/';

constructor(selectedCategory, bookId) {
this.selectedCategory = selectedCategory;
this.bookId = bookId;
}
// -------------Запит на категорії-----------------------------
booksListRequest() {
return axios.get(`${this.#BASE_URL}books/category-list`);
}

// ---------------Запит на ТОП книги(бестселлери)-----------------

topBooksRequest() {
return axios.get(`${this.#BASE_URL}books/top-books`);
}
}

0 comments on commit 435c555

Please sign in to comment.