I am working in Angular project which is connected to REST API. Here we have an endpoint to create and update room types. POST endpoint for create and PUT endpoint for update exiting room types.
Both POST & PUT API endpoints were developed to take one room type at a time as the payload. But frontend angular application allow users to create and edit multiple room type at once. And it has one save button to save all room types.
In that case which one is the best & reliable approach to go forward.
Pick all changes of room types and create payload for each one and send multiple POST or PUT call from frontend application. as an example :- if user edit 10 room type angular app will be sending 10 http calls.
Redesign the REST API call to take the multiple room types as payload. example :- all 10 room type details will be attached to the payload as list and send once.
Kindly have your thoughts on this.
Thanks Nuwan