How to update media file within an entry

System Information
  • Strapi Version: 4
  • Operating System: win 11
  • Database: sql lite
  • Node Version: latest
  • NPM Version: latest
  • Yarn Version: latest

if i have an article collection type with
----- if i want to update this article from the frontend with react
let’s say we have an article entity with 2 photos (x, z)
------ while updating i want to :
remove photo x
keep z
add 2 more photos
---- what can we do to achieve this?

I solved it, anyone needs to know about it, reach me out at Ahmed hassan