link in api parameter

question-12
Bastien JACQUELIN 1 year ago
parent 1e6b265bd8
commit c25a135d98

@ -1,7 +1,7 @@
class ApiService{
constructor(){}
async get(id){
const baseUrl = `https://jsonplaceholder.typicode.com/posts/${id}`;//edit
async get(link){
const baseUrl = `${link}`;//edit
const headers = {
method: 'GET'
};
@ -10,8 +10,8 @@ class ApiService{
console.log(responseJson)
}
async post(){
const baseUrl = `https://jsonplaceholder.typicode.com/posts/`;//edit
async post(link){
const baseUrl = `${link}`;//edit
const headers = {
method: 'POST',
headers: {

Loading…
Cancel
Save