I have a flow where a user is prompted to add multiple photos (to a post / listing).
My initial setup is a preview window for all uploaded photos (a grid generating dynamic children) and an "Upload" button. The concept is to allow a user to preview all uploaded photos before posting, add / delete some, and then finalize the listing. The pictures are being loaded into a Supabase bucket, and after a user confirms the photo list, a list of those URLs is added to a respective table / row.
I do, however, have the following questions I would greatly appreciate assistance with:
01. How do I add a list of URLs from the upload action to the Page State variable? "Add to list" demands some sorting or filtering which I am perplexed about. 'Set value' seems to only be adding the first URL to the list - works fine for adding photos one-by-one, but not good for bulk uploads, especially when they have all been already uploaded to Supabase. Basically, all I need is a generated list of all URLs to be dumped into a list, with any additional uploads (of more than 1 item in a batch) to be added to the same list.
02. What is the best practice for photo uploading flows like mine? Would you recommend to create a 'temporary' upload for photo manipulation (add / delete more items), and then write to a 'permanent' bucket / add a DB record, etc., or just create the full DB table entry with all URLs and proceed with any changes instantly reflected in the DB?
Adding multiple photos: Best practices and technical query
Actions & Logic
Checked FF documentation. Could not find clear explanation of all those 'Add to list' functionality.
Yes
5 replies