These are chat archives for FreeCodeCamp/HelpJavaScript

25th
Aug 2018
Pagnito
@Pagnito
Aug 25 2018 02:32
for some reason i get this error like 1 out of 5 times when i load my page
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 429
it seems on almost every initial load it gives me this error
Pagnito
@Pagnito
Aug 25 2018 04:33
Actions must be plain objects. Use custom middleware for async actions.
i dont understand why im getting this
im only making one action request
abraham anak agung
@padunk
Aug 25 2018 07:11
@Pagnito What is your code?
this is the repo but honestly its alot to look thru i dunno if anyone would wanna do that
export const getPosts = (dispatch) => {
    axios
        .get('/api/posts')
        .then((res) => {
            dispatch({
                type: GET_POSTS,
                payload: res.data
            });
        })
        .catch((err) => {
            dispatch({
                type: GET_ERRORS,
                payload: err.response.data
            });
        });
};
thats my action and icant understand why the simples of actions is telling me this bullshit
alpox
@alpox
Aug 25 2018 18:01
@Pagnito Your problem is that you are not returning a proper thunk
@Pagnito you need export const getPosts = () => (dispatch) => {
And not export const getPosts = (dispatch) => {
Pagnito
@Pagnito
Aug 25 2018 18:02
OMG
THANK YOU
I LOVE YOU
alpox
@alpox
Aug 25 2018 18:02
@Pagnito np
Pagnito
@Pagnito
Aug 25 2018 18:02
i kept lookin at that and was like hmm seems ok
my head is spun
Pagnito
@Pagnito
Aug 25 2018 19:03
finally built my 2nd full stack app that was actually fun to build
Pagnito
@Pagnito
Aug 25 2018 19:09
oof forgot to do the google auth
lol
oh well
gotta work on my bros project, he been waiting
Pagnito
@Pagnito
Aug 25 2018 20:21
Anyone ever use deck gl?
Chris Cullen
@123xylem
Aug 25 2018 21:42
function showMenu() {
  document.querySelector("nav").css({"display":"block"});
}
Any idea how to make this work?
onclick show the nav
alpox
@alpox
Aug 25 2018 21:51
@123xylem document.querySelector("nav").style.display = "block";
Chris Cullen
@123xylem
Aug 25 2018 21:51
thanks