Hack-Day icon indicating copy to clipboard operation
Hack-Day copied to clipboard

Change the path of "data.json" file in profileAdd.js

Open arc9693 opened this issue 5 years ago • 5 comments

Currently, the path is the URL of the data.json file in the main repository. People who build on their local and try to add their cards, cannot see their cards until their PR is finally merged. To correct this, we have to include the relative path of the data.json file.

https://github.com/lugnitdgp/Hack-Day/blob/e296f26c67aad38497e27bcaa525d28f60968463/assets/js/profileAdd.js#L1

A similar change is required in the following file: https://github.com/lugnitdgp/Hack-Day/blob/e296f26c67aad38497e27bcaa525d28f60968463/assets/js/repoAdd.js#L2

arc9693 avatar Oct 01 '20 08:10 arc9693

Hey @arc9693 can i work on this one? Thanks

therealansh avatar Oct 01 '20 08:10 therealansh

@therealansh Go ahead. I have assigned you the issue.

arc9693 avatar Oct 01 '20 08:10 arc9693

Hey @arc9693 , Using getJson to fetch data from local files would throwback an issue of CORS (cross origin request). Therefore, only https requests are possible. We could solve this issue by running the page on a localhost, by running a xampp or a lamp server

therealansh avatar Oct 01 '20 09:10 therealansh

@therealansh @arc9693 Use this with your url: https://cors-anywhere.herokuapp.com/ This will bypass CORS errors from your FE calls

Rajdeepc avatar Oct 01 '20 10:10 Rajdeepc

@arc9693 I have created a PR, kindly review it

ujalak1812 avatar Oct 01 '20 11:10 ujalak1812