Skip to content

Commit

Permalink
Make json bin data private
Browse files Browse the repository at this point in the history
  • Loading branch information
ayu023ban committed Sep 11, 2021
1 parent c405265 commit 300da44
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/data/onlineDataMap.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const profileData = "613c9cb24a82881d6c4d109c";
export const jobsData = "613c9c284a82881d6c4d1065";
export const projectsData = "613c9c0a4a82881d6c4d105d";
export const configData = "613cab2b4a82881d6c4d15f2";
export const profileData = "613c9c489548541c29b00ce2";
export const jobsData = "613cce624a82881d6c4d22c1";
export const projectsData = "613c9a0daa02be1d44465161";
export const configData = "613cce34aa02be1d4446649f";
9 changes: 5 additions & 4 deletions src/hoc/DataContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ export default ({ children }) => {
const [config, setConfig] = useState({ max_project_to_show: 3 });

useEffect(() => {
getRequest(`https://api.jsonbin.io/b/${profileData}`).then((res) => {
const root = "https://api.jsonbin.io/v3/b";
getRequest(`${root}/${profileData}/latest/`).then((res) => {
setProfile(res);
});
getRequest(`https://api.jsonbin.io/b/${jobsData}`).then((res) => {
getRequest(`${root}/${jobsData}/latest/`).then((res) => {
setJobs(res);
});
getRequest(`https://api.jsonbin.io/b/${projectsData}`).then((res) => {
getRequest(`${root}/${projectsData}/latest/`).then((res) => {
setProjects(res);
});
getRequest(`https://api.jsonbin.io/b/${configData}`).then((res) => {
getRequest(`${root}/${configData}/latest/`).then((res) => {
setConfig(res);
});
}, []);
Expand Down
1 change: 1 addition & 0 deletions src/services/networkService.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export function getRequest(url) {
const headers = {
"X-Master-Key": process.env.REACT_APP_JSONBIN_MASTER_KEY,
"X-Bin-Meta": false,
};
return fetch(url, { method: "GET", headers: headers }).then((res) =>
res.json()
Expand Down

0 comments on commit 300da44

Please sign in to comment.