Giter Club home page Giter Club logo

Comments (4)

LartTyler avatar LartTyler commented on August 17, 2024

@KarisD Glad you're liking the API! All endpoints should have the necessary CORS headers, so you may want to check your client configuration. If you're not able to resolve the issue on your end, feel free to send me the relevant code snippet, and I'll see if I can point you in the right direction.

from mhwdb-docs.

karis404 avatar karis404 commented on August 17, 2024

Hey! Still not sure what I'm doing wrong. It's a React app, here is my code. I call this method when loading components to the UI.


export function fetchWeapons() {
    return dispatch => {
      dispatch(fetchWeaponsBegin());
      return fetch("https://mhw-db.com/weapons")
        .then(handleErrors)
        .then(res => res.json())
        .then(json => {
          dispatch(fetchWeaponsSuccess(json));
          return json;
        })
        .catch(error => dispatch(fetchWeaponsFailure(error)));
    };
  }

The fetch will work with armor but doesn't for weapons. I'll keep researching, but if anything sticks out to you, let me know.

Thanks!

from mhwdb-docs.

LartTyler avatar LartTyler commented on August 17, 2024

Your code looks fine, so just in case, I went and cleared out the Cloudflare cache. I'm wondering if maybe it's just some weirdness with how that endpoint got cached. Make sure you clear your browser's cache before trying again, and please let me know if it continues to happen.

from mhwdb-docs.

karis404 avatar karis404 commented on August 17, 2024

@LartTyler Hey, that did the trick. Tried it again before clearing browser cache and it worked. Thanks for your help!!
image

from mhwdb-docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.