Page body
What this form covers
Distribution Lists has no standalone create page. The current FE exposes two form behaviors:
- a standalone edit page used to rename an existing list
- an implicit create branch in the upload card when no target list is selected
Rename flow
On /distribution-lists/edit/[id], the operator can:
- load the current list detail
- change the
Name - save the new value with
PUT /api/newsletter/distribution-lists/:id - reset the local field back to the loaded backend value without sending a request
- review the current contacts grid rendered under the form
- see
Saving...on the submit button while the rename request is in flight
Implicit create flow
On the Email Newsletters -> Distribution Lists tab:
- the operator can choose
Attach to List (optional)and leave it onCreate new list - the operator selects a CSV file, can run
Check File, and then runsUpload CSV - the operator may leave
Attach to Listempty - after a successful file upload, the FE calls
POST /api/newsletter/distribution-listsonly when no existing list was selected - the new list name is derived from the uploaded file name or from a timestamp fallback
- the FE then parses the CSV locally, extracts deduplicated email-like rows, and continues with the add-contacts step
- the result dialog exposes counts such as
Inserted,Updated,Existing,New,Contact File ID, andAttached Count
Upload helper behavior that matters
Check Fileonly calls the preview route and never creates a list or attaches contacts.Upload CSVuploads the file first, then optionally creates a list, then attempts contact attachment.Create new listis a default empty-option branch, not a separate route. The helper names the new list from the file name without extension when possible.- Contact attachment is best-effort after upload. A failed create-or-attach step does not roll back the file upload result.
- The FE clears the selected file after a successful upload, but does not clear the selected target list.
Important caveats
- The implicit create branch is part of the upload workflow, not a separate route.
- The current edit page only exposes a single editable field:
Name. - The form does not expose delete, archive, or remove-contact actions on the verified FE surface.
- Contact attachment only parses rows that contain an email-like value and only after the upload step succeeds.
- The list table in the upload card has two navigation paths: the
Namebutton opens the standalone detail page, while the pencil icon opens the rename page.