Im trying to develop a dynamic todoList. I have two components TodoList, and Todo. TodoList fetches with useSWR the data from Mongo and puts the data in a div depending if they’re completed or not. Todo component has a button to mark if the task its completed or not. When you click the input check it changes automatically on mongo.
Tag: fetch
How can I detect if a var was passed and then block it from passing again?
I have a quick question, My project is a quick 4 option answers, With radio buttons and pictures displayed, Now I have the pictures and the answers stored in a text file, That way my JS detects what it reads and then passes it to HTML, Now I use this function to pick a random line: Now How would I
Trying to sort an API set by date range
Good day everyone, I’ve fetched this set of data from new york city’s open data API portal and am trying to sort all entries by endpoint inspection_date within the past two years. I’d also like to sort the results by the latest times first. However, I’m having trouble getting my endpoints to cooperate. I’ve read the API documentation several times
React returns several errors when I import fetch
I am building a simple app using React. The app works fine without any issue until I import fetch. Here is the code I ran: App.js Some of the errors returned are: What I tried to resolve the errors are: Trying to substitute fetch with axios. But it seems to return the same errors. Adding experiments: { topLevelAwait: true }
Fastest way to send 500 requests using JS
I need to write a function that fetches the rate limit test page 500 times with a 200 status code as fast as possible. Cloudflare will rate limit you if you make more than 10 requests within a minute to https://www.cloudflare.com/rate-limit-test. This is my code so far: Is there a better way of doing this and using setTimeOut? Answer 10
Why Does My Array Populate on Rebuild But Not on Page Refresh?
I am using Vue 3 with Composition API, a Pinia store, TypeScript, SQL backend and Fetch to grab the data via my .NET 6 API. I have a User.ts class and I Fetch the data from the DB using the below method For all the other data in my app, I have had no issues. However, when I refresh the
Why is fetch calling api multiple times in react?
I have a very basic api and all it does is return the text “Sunny day”. I create a react project using create react app and try to call the api once then printing result to the console. Here is the react app The problem is the api is getting called twice on page load Can anybody explain why? Answer
Uncaught TypeError: Cannot read properties of undefined (reading ‘name’) | Material UI
I’m trying to view the fetched data on MUI Autocomplete, but I get this error I don’t why, the stat is fetched from MongoDB and I’m just trying to view the name of the category as an option. The Code: This is how the data is showing in Mongodb Answer So I added this and it worked getOptionLabel={option => (option
fetching and passing params in react navigation
On Press of a button I need to pass params to another screen where value of that button is fetched, code below; screen:1 screen:2 But during the fetching I get the following error I have tried using timeout but that is not working, is there a better option. Answer The issue is that fetch is a native function in javascript
Elastic API doesn’t show all documents
i have elastic that i want to fetch the data from elastic with query, i have about 210 documents in the index, but when i tried to search with query match_all, the api only showing 7 documents and not all documents, is it possible to api showing all documents instead only show some documents. The query : The elastic API