mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-04 00:31:12 -06:00
Skeleton bundle component some more
This commit is contained in:
33
src-ui/src/app/services/rest/share-bundle.service.ts
Normal file
33
src-ui/src/app/services/rest/share-bundle.service.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Injectable } from '@angular/core'
|
||||
import { Observable } from 'rxjs'
|
||||
import {
|
||||
ShareBundleCreatePayload,
|
||||
ShareBundleSummary,
|
||||
} from 'src/app/data/share-bundle'
|
||||
import { AbstractNameFilterService } from './abstract-name-filter-service'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ShareBundleService extends AbstractNameFilterService<ShareBundleSummary> {
|
||||
constructor() {
|
||||
super()
|
||||
this.resourceName = 'share_bundles'
|
||||
}
|
||||
|
||||
createBundle(
|
||||
payload: ShareBundleCreatePayload
|
||||
): Observable<ShareBundleSummary> {
|
||||
this.clearCache()
|
||||
return this.http.post<ShareBundleSummary>(this.getResourceUrl(), payload)
|
||||
}
|
||||
|
||||
listBundlesForDocuments(
|
||||
documentIds: number[]
|
||||
): Observable<ShareBundleSummary[]> {
|
||||
const params = { documents: documentIds.join(',') }
|
||||
return this.http.get<ShareBundleSummary[]>(this.getResourceUrl(), {
|
||||
params,
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user