calvh / mooden

A simple tool to track your mood
0 stars 1 forks source link

Use redirect: "follow" option in fetch requests #37

Open calvh opened 3 years ago

calvh commented 3 years ago

Test the following:

fetch(url, { method: 'POST', redirect: 'follow'})
    .then(response => {
        // HTTP 301 response
    })
    .catch(function(err) {
        console.info(err + " url: " + url);
    });

Replace occurences of window.location.replace(response.url); if it works