skip to Main Content

Javascript – DELETE Swagger API entry with JS

I'm trying to delete entry [i] from Swagger API with a button. function deleteWork(id) { fetch("http://localhost:5678/api/works/" + id, { method: "DELETE", headers: {"Content-Type": "application/json"}, body: JSON.stringify( { "id": id }) }) } The following code is inside a for loop,…

VIEW QUESTION

Reactjs – React axios get parameter is undefined

I want to get some data from an api with a parameter current user's username. useEffect(()=>{ console.log(currentUser[0]?.id.toString()) if (currentUser) { console.log(currentUser[0]?.id.toString()) axios.get(`http://127.0.0.1:8000/get_chat2/?user1=${currentUser[0]?.id.toString()}&user2=`).then(res=>{ setUsers(res.data) console.log(res.data) }) },[currentUser]) When I print currentUser[0]?.id.toString() I get user's id but when I send the request…

VIEW QUESTION

Asp.net – After saving the data to the database once, it does not save the second one

I'm pretty new to this industry. This is the Create method in BaseRepository: public async Task CreateAsync(TEntity entity) { await _db.Set<TEntity>().AddAsync(entity); await _db.SaveChangesAsync(); } This is the Create method inside the UserService class. public ResultService<UserCreateDTO> Create(UserCreateVM userCreateVM) { ResultService<UserCreateDTO> result…

VIEW QUESTION
Back To Top
Search