Last active
April 26, 2017 03:53
-
-
Save Dyndrilliac/ecc8a86ce6f6302ed4802295375bbe24 to your computer and use it in GitHub Desktop.
COP-4813-Final-Project
This file contains 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
const BASE_URL = "proxy/api/v2/" | |
const URLS = { | |
ENDPOINTS: BASE_URL, | |
DAYSOFWEEK: BASE_URL + "daysofweek/", | |
EQUIPMENT: BASE_URL + "equipment/", | |
EXERCISE: BASE_URL + "exercise/", | |
EXERCISEINFO: BASE_URL + "exerciseinfo/", | |
EXERCISECATEGORY: BASE_URL + "exercisecategory/", | |
EXERCISECOMMENT: BASE_URL + "exercisecomment/", | |
EXERCISEIMAGE: BASE_URL + "exerciseimage/", | |
INGREDIENT: BASE_URL + "ingredient/", | |
INGREDIENTWEIGHTUNIT: BASE_URL + "ingredientweightunit/", | |
LANGUAGE: BASE_URL + "language/", | |
LICENSE: BASE_URL + "license/", | |
MUSCLE: BASE_URL + "muscle/", | |
WEIGHTUNIT: BASE_URL + "weightunit/", | |
SETTING_REPETITIONUNIT: BASE_URL + "setting-repetitionunit/", | |
SETTING_WEIGHTUNIT: BASE_URL + "setting-weightunit/", | |
}; | |
function getData(request) { | |
var retVal = null; | |
$.ajax({ | |
url: request + "?format=json", | |
dataType: "json", | |
success: (data) => { | |
retVal = data; | |
} | |
}); | |
return retVal; | |
} | |
var endpoints; | |
var daysofweek; | |
var equipment; | |
var exercise; | |
var exerciseinfo; | |
var exercisecategory; | |
var exercisecomment; | |
var exerciseimage; | |
var ingredient; | |
var ingredientweightunit; | |
var language; | |
var license; | |
var muscle; | |
var weightunit; | |
var setting_repetitionunit; | |
var setting_weightunit; | |
$(document).ready((e) => { | |
endpoints = getData(URLS.ENDPOINTS); | |
daysofweek = getData(URLS.DAYSOFWEEK); | |
equipment = getData(URLS.EQUIPMENT); | |
exercise = getData(URLS.EXERCISE); | |
exerciseinfo = getData(URLS.EXERCISEINFO); | |
exercisecategory = getData(URLS.EXERCISECATEGORY); | |
exercisecomment = getData(URLS.EXERCISECOMMENT); | |
exerciseimage = getData(URLS.EXERCISEIMAGE); | |
ingredient = getData(URLS.INGREDIENT); | |
ingredientweightunit = getData(URLS.INGREDIENTWEIGHTUNIT); | |
language = getData(URLS.LANGUAGE); | |
license = getData(URLS.LICENSE); | |
muscle = getData(URLS.MUSCLE); | |
weightunit = getData(URLS.WEIGHTUNIT); | |
setting_repetitionunit = getData(URLS.SETTING_REPETITIONUNIT); | |
setting_weightunit = getData(URLS.SETTING_WEIGHTUNIT); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment