Modify the logic of uploading attachments

my front end needs to modify attachments, so it includes the following situations:
1. Delete all uploaded attachments
2. Delete some uploaded attachments
3. Upload a new attachment
4. Delete some attachments and upload new attachments

so how does the background judge this logic and implement it?

May.15,2022

two methods:

  1. delete immediately. When deleting, request the server immediately, delete the attachment, and respond synchronously on the page
  2. submit deletion. Request the server when you click the submit button. When deleting the attachment, you need to record the id of the deleted attachment, and so on, the server receives the deleted attachment
Menu