-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #545 from hackforla/399-FRONT-VersionAndShasInFooter
displaying version and github shas in footer
- Loading branch information
Showing
9 changed files
with
183 additions
and
35 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
export const types = { | ||
GET_METADATA_REQUEST: 'GET_METADATA_REQUEST', | ||
GET_METADATA_SUCCESS: 'GET_METADATA_SUCCESS', | ||
GET_METADATA_FAILURE: 'GET_METADATA_FAILURE', | ||
}; | ||
|
||
export const getMetadataRequest = () => ({ | ||
type: types.GET_METADATA_REQUEST, | ||
}); | ||
|
||
export const getMetadataSuccess = response => ({ | ||
type: types.GET_METADATA_SUCCESS, | ||
payload: response, | ||
}); | ||
|
||
export const getMetadataFailure = error => ({ | ||
type: types.GET_METADATA_FAILURE, | ||
payload: error, | ||
}); | ||
|
||
const initialState = {}; | ||
|
||
export default (state = initialState, action) => { | ||
switch (action.type) { | ||
case types.GET_METADATA_SUCCESS: | ||
return { | ||
...action.payload, | ||
}; | ||
case types.GET_METADATA_FAILURE: { | ||
const { | ||
response: { status }, | ||
message, | ||
} = action.payload; | ||
|
||
return { | ||
...state, | ||
error: { | ||
code: status, | ||
message, | ||
error: action.payload, | ||
}, | ||
}; | ||
} | ||
default: | ||
return state; | ||
} | ||
}; |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import axios from 'axios'; | ||
import { | ||
takeLatest, | ||
call, | ||
put, | ||
} from 'redux-saga/effects'; | ||
|
||
import { | ||
types, | ||
getMetadataSuccess, | ||
getMetadataFailure, | ||
} from '../reducers/metadata'; | ||
|
||
function* getMetadata() { | ||
const url = `${process.env.DB_URL}/apistatus`; | ||
try { | ||
const { data } = yield call(axios.get, url); | ||
yield put(getMetadataSuccess(data)); | ||
} catch (e) { | ||
yield put(getMetadataFailure(e)); | ||
} | ||
} | ||
|
||
export default function* rootSaga() { | ||
yield takeLatest(types.GET_METADATA_REQUEST, getMetadata); | ||
} |
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