0
votes

I am using Swift and SwiftUI to create an app. After a user inserts a new record using the JSON API, I fetch all the records again and then display it on the screen. Is this a good practice to fetch all records from the JSON API after each insert? Or should I return the new ID of the record and assign it to the record and then add that record to the list/array. This will save me one trip to the API.

Recommendations?