Last active
November 2, 2016 04:58
-
-
Save adnaan/130b14a7590f8c1a322fb23b55de38c7 to your computer and use it in GitHub Desktop.
src/services.js
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
/*@flow*/ | |
export async function getProducts() { | |
return fetch(`/api/products`).then(res => res.json()) | |
} | |
export async function updateVote(id: { id: number }) { | |
return fetch('/api/products/vote/' + String(id)).then(res => res.json()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment