Problem and Solutions
AutoComplete: get the id for the user that i was choosen from users list, post request with status 400 in react.js ?
By M.K. Verma · 2 May 2022

Based on your code I observed this.
- You are already passing
invoice?.idinstatusGropButton(invoice.status, invoice?.id)method. - You are again expecting
idfrom the input asid?.idinassignToUser(id?.id, users.id, message). Why?
Just assuming, because of that the invoiceId is going as undefined. Try by passing just id instead of id?.id while calling the api functions.
You are opening a Dialogue by using assignToUserDialog flag. While submitting the form, you are doing dispatch(assignToUser(id?.id, users.id, message)); in which users is an array. That is the reason you are getting undefined. I would suggest you maintain the specific user information for which the dialogue is opened and send that specifc user.id to the API call.