Ive been asked to solve the above issue. Batch updates aside, my understanding of it is we want to limit the user to only being able to add one unsaved item/portfolio/form at a time (while allowing the user to add as many saved forms as he desires)
Here are the instructions I recieved on discord though I didnt understand them (as it makes it seem like im supposed to only allow one portfolio item in total) :
here is how I solved it, please let me know what changes to make if any. for me its working as expected:
P.S. I am assuming that it is saved based off actions on the client without checking any response from the server to know if it is in fact truly “saved”. Is it necessary to write tests?
Edit: the code doesnt work when you reload the page because isSaved property is not saved to the database, I think if its added than it will work
Edit: I think there is also small bug onSubmit button isPristine lodash isEqual because of that prop I added, (it should be disabled after first click)