Commit e4fe203f authored by MrMan's avatar MrMan

Change argument order for GetWithToken

parent 2c2dbad5
......@@ -119,7 +119,7 @@ let RecommendationStore = Reflux.createStore({
// Fetch Tinder recs
console.log("[TINDER RECOMMENDATION STORE] Performing GET...");
this.state.requestInFlight = true;
TinderAPI.GETWithToken(this.state.tinderAccessToken, Constants.TINDER_RECS_URL)
TinderAPI.GETWithToken(Constants.TINDER_RECS_URL, this.state.tinderAccessToken)
.then(resp => resp.json())
.then(resp => {
if (resp.status == 200) {
......
......@@ -92,7 +92,7 @@ let TinderSentimentStore = Reflux.createStore({
}
console.log("[TINDER SENTIMENT STORE] URL for sentiment:", generateTinderURLFromSentiment(sentiment));
TinderAPI.GETWithToken(this.state.tinderAccessToken, generateTinderURLFromSentiment(sentiment))
TinderAPI.GETWithToken(generateTinderURLFromSentiment(sentiment), this.state.tinderAccessToken)
.then(resp => resp.json())
.then(resp => {
// Handle sentiment failure (for whatever reason tinder specifies)
......
......@@ -38,7 +38,6 @@ export default {
/**
* Perform a POST request to the tinder API, with all requisite information
*
* @param {string} token - The tinder API token
* @param {string} url - The URL to POST to
* @param {object} bodyJson - The body of the post request
* @returns {Promise} the fetch request promise
......@@ -63,11 +62,11 @@ export default {
/**
* Perform a GET request to the tinder API, with the access token provided
*
* @param {string} token - The tinder API token
* @param {string} url - The URL to POST to
* @param {string} token - The tinder API token
* @returns {Promise} the fetch request promise
*/
GETWithToken(token, url) {
GETWithToken(url, token) {
return fetchFromTinderAPI(url, "get", null, {'X-Auth-Token': token})
.then(this.detectAuthErrorResponse);
},
......
......@@ -67,7 +67,7 @@ describe("Tinder API", () => {
let tinderAPI = api.default;
// Perform GET with API, manually verify url and opts that are returned
tinderAPI.GETWithToken(TEST_TINDER_TOKEN, TEST_URL)
tinderAPI.GETWithToken(TEST_URL, TEST_TINDER_TOKEN)
.then((res) => {
res.url.should.be.exactly(TEST_URL);
res.opts.should.have.keys("headers");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment