Commit 8d2ac92c authored by Andrew Hrdy's avatar Andrew Hrdy

Classifier for API request now uses environment variables. Closes #16.

parent 5d4bfb0b
Pipeline #2093 passed with stages
in 1 minute and 53 seconds
......@@ -10,24 +10,20 @@ build:
API_GET_FACILITIES: "https://api.srct.gmu.edu/whatsopen/v2/facilities/"
script:
- npm install -g yarn
- >
sed "s|^const API_GET_FACILITIES .*|const API_GET_FACILITIES = '$API_GET_FACILITIES';|" -i src/actions/api.js
- yarn install
- CI=false npm run build
- CI=false REACT_APP_API_GET_FACILITIES=API_GET_FACILITIES npm run build
artifacts:
paths:
- build
build_shopmason:
stage: build
variables:
API_GET_FACILITIES: "https://api.srct.gmu.edu/whatsopen/v2/facilities/?facility_classifier=shopmason"
script:
- npm install -g yarn
- >
sed "s|^const API_GET_FACILITIES .*|const API_GET_FACILITIES = '$API_GET_FACILITIES';|" -i src/actions/api.js
- yarn install
- CI=false npm run build
- CI=false REACT_APP_API_GET_FACILITIES=API_GET_FACILITIES npm run build
artifacts:
paths:
- build
......
import {GET_ALERTS, GET_FACILITIES, SET_ALERTS, SET_FACILITIES, SORT_FACILITY_CARDS, VIEW_ALERT } from './action-types';
import {GET_ALERTS, GET_FACILITIES, SET_ALERTS, SET_FACILITIES, SORT_FACILITY_CARDS, VIEW_ALERT} from './action-types';
const API_GET_FACILITIES = 'https://api.srct.gmu.edu/whatsopen/v2/facilities/';
const API_GET_FACILITIES = process.env.REACT_APP_API_GET_FACILITIES ? process.env.REACT_APP_API_GET_FACILITIES :
'https://api.srct.gmu.edu/whatsopen/v2/facilities/';
const API_GET_ALERTS = 'https://api.srct.gmu.edu/whatsopen/v2/alerts/?ordering=urgency_tag';
// SHOP MASON ONLY
//const API_GET_FACILITIES = 'https://api.srct.gmu.edu/whatsopen/v2/facilities/?facility_classifier=shopmason';
export const getFacilities = () => (dispatch) => {
dispatch({
type: GET_FACILITIES
......
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