mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-14 02:27:06 +01:00
Enhancement: process mail button (#8466)
This commit is contained in:
parent
2ac2a6dec6
commit
dafb0b1f21
9 changed files with 196 additions and 49 deletions
|
|
@ -68,6 +68,14 @@ describe(`Additional service tests for MailAccountService`, () => {
|
|||
expect(service.allAccounts).toEqual(mail_accounts)
|
||||
})
|
||||
|
||||
it('should support processAccount', () => {
|
||||
subscription = service.processAccount(mail_accounts[0]).subscribe()
|
||||
const req = httpTestingController.expectOne(
|
||||
`${environment.apiBaseUrl}${endpoint}/${mail_accounts[0].id}/process/`
|
||||
)
|
||||
expect(req.request.method).toEqual('POST')
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
// Dont need to setup again
|
||||
|
||||
|
|
|
|||
|
|
@ -47,4 +47,8 @@ export class MailAccountService extends AbstractPaperlessService<MailAccount> {
|
|||
delete account['set_permissions']
|
||||
return this.http.post(this.getResourceUrl() + 'test/', account)
|
||||
}
|
||||
|
||||
processAccount(account: MailAccount) {
|
||||
return this.http.post(this.getResourceUrl(account.id, 'process'), {})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue