WIP: form attachments — unit tests, test e-mail with attachment, lint
Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
02b1e96d3d
commit
701bb420c1
@@ -223,7 +223,7 @@ export function buildFormsPlugin(forms: FormsOption): Plugin {
|
||||
? async (emails, args) => {
|
||||
const noticed = fileNotice ? await fileNotice(emails, args) : emails
|
||||
const laidOut = layout ? await layout(noticed, args) : noticed
|
||||
const changed = forms.beforeEmail ? await forms.beforeEmail(laidOut, args) : laidOut
|
||||
const changed = forms.beforeEmail ? await Promise.resolve(forms.beforeEmail(laidOut, args)) : laidOut
|
||||
return fileDelivery ? fileDelivery(changed, args) : changed
|
||||
}
|
||||
: undefined
|
||||
@@ -314,8 +314,8 @@ export function buildFormsPlugin(forms: FormsOption): Plugin {
|
||||
if (!attachments) {return builder}
|
||||
// The submit endpoint for forms with files, and the resolved option where
|
||||
// submitForm and the endpoint read it (payload.config.custom.ipal.formAttachments).
|
||||
return async (incoming) => {
|
||||
const config = await builder(incoming)
|
||||
return (incoming) => {
|
||||
const config = builder(incoming)
|
||||
return {
|
||||
...config,
|
||||
custom: { ...config.custom, ipal: { ...(config.custom?.ipal as object | undefined), formAttachments: attachments } },
|
||||
|
||||
Reference in New Issue
Block a user