Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

add ability to manually clear the cache on matching models

jonaswinkler544ca8d00823
diff --git a/src-ui/src/app/services/rest/abstract-paperless-service.ts b/src-ui/src/app/services/rest/abstract-paperless-service.ts
index f57956754..8ad1a2141 100644
--- a/src-ui/src/app/services/rest/abstract-paperless-service.ts
+++ b/src-ui/src/app/services/rest/abstract-paperless-service.ts
@@ -74,27 +74,31 @@ export abstract class AbstractPaperlessService<T extends ObjectWithId> {
)
}
+ clearCache() {
+ this._listAll = null
+ }
+
get(id: number): Observable<T> {
return this.http.get<T>(this.getResourceUrl(id))
}
create(o: T): Observable<T> {
- this._listAll = null
+ this.clearCache()
return this.http.post<T>(this.getResourceUrl(), o)
}
delete(o: T): Observable<any> {
- this._listAll = null
+ this.clearCache()
return this.http.delete(this.getResourceUrl(o.id))
}
update(o: T): Observable<T> {
- this._listAll = null
+ this.clearCache()
return this.http.put<T>(this.getResourceUrl(o.id), o)
}
patch(o: T): Observable<T> {
- this._listAll = null
+ this.clearCache()
return this.http.patch<T>(this.getResourceUrl(o.id), o)
}