mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Make subject optional too
This commit is contained in:
parent
ac6f5b497c
commit
dd6c8cf6dc
2 changed files with 16 additions and 1 deletions
|
|
@ -36,7 +36,7 @@ interface EmailMessage {
|
|||
}
|
||||
|
||||
function isEmailMessage(data: any): data is EmailMessage {
|
||||
return 'from' in data && 'to' in data && 'subject' in data
|
||||
return 'from' in data && 'to' in data
|
||||
}
|
||||
|
||||
const logger = buildLogger('app.dispatch')
|
||||
|
|
|
|||
|
|
@ -163,5 +163,20 @@ describe('Emails Router', () => {
|
|||
|
||||
expect(res.body.id).not.to.be.undefined
|
||||
})
|
||||
|
||||
it('saves the email if subject is empty', async () => {
|
||||
const data = {
|
||||
from,
|
||||
to: newsletterEmail,
|
||||
html,
|
||||
}
|
||||
const res = await request
|
||||
.post(url)
|
||||
.set('Authorization', `${authToken}`)
|
||||
.send(data)
|
||||
.expect(200)
|
||||
|
||||
expect(res.body.id).not.to.be.undefined
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue