Fix: get highest ASN regardless of user (#4326)

This commit is contained in:
shamoon
2023-10-06 17:22:31 -07:00
committed by GitHub
parent a2bdd64ad0
commit f7f5d0efa6
6 changed files with 75 additions and 45 deletions

View File

@@ -229,6 +229,14 @@ describe(`DocumentService`, () => {
`${environment.apiBaseUrl}${endpoint}/${documents[0].id}/preview/#search="${searchQuery}"`
)
})
it('should support get next asn', () => {
subscription = service.getNextAsn().subscribe((asn) => asn)
const req = httpTestingController.expectOne(
`${environment.apiBaseUrl}${endpoint}/next_asn/`
)
expect(req.request.method).toEqual('GET')
})
})
beforeEach(() => {

View File

@@ -143,6 +143,10 @@ export class DocumentService extends AbstractPaperlessService<PaperlessDocument>
return url
}
getNextAsn(): Observable<number> {
return this.http.get<number>(this.getResourceUrl(null, 'next_asn'))
}
update(o: PaperlessDocument): Observable<PaperlessDocument> {
// we want to only set created_date
o.created = undefined