I have the following controller method to get array of ids and then remove but what I send from react does not caught here.
@DeleteMapping({"delete-user"})
public GenericResponse deleteUser(@RequestBody String[] ids, Errors errors) {
if (errors.hasErrors())
throw new ParseException();
return userService.delete(Arrays.asList(ids));
}
React request snippet
yield call(userDeleteService, payload.ids)
What payload is
callback: undefined
ids: Array(1)
0: "08ddc3f3-9df3-463f-8d95-25a4633f24b7"
length: 1
This is the request that is sent from react side.
http://localhost:8080/user/delete-user?0=08ddc3f3-9df3-463f-8d95-25a4633f24b7&1=11036b08-8daa-44ef-a557-9723f20b8911&
http://localhost:8080/user/delete-user?ids=<id1>&ids=<id2>etc... the request u currently have is wrong...0is an index for the FE but for thejavait's nonsense and definitely not an item from theidsarray.idsas parameters, that is really bad.Try @BogdanSucaciu solution that is the proper way to implement this