Created
November 19, 2019 17:20
-
-
Save nachodd/ae51edabbe19adb7f5bb6bc4c2542a0d to your computer and use it in GitHub Desktop.
api calls example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from "axios" | |
export function getSellers() { | |
return axios({ | |
url: "v1/sellers/", | |
method: "get", | |
}) | |
} | |
export function createInvoice(data) { | |
return axios({ | |
url: "v1/invoices", | |
method: "post", | |
data, | |
}) | |
} | |
export function getImages(searchQuery) { | |
const apiKey = process.env.PIXABAY_TOKEN | |
const url = `https://pixabay.com/api/?key=${apiKey}&q=${searchQuery}s&image_type=photo&per_page=15&safesearch=true` | |
return axios({ | |
url, | |
method: "get", | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment