RED-6318: update last changed before the request

This commit is contained in:
Dan Percic 2023-03-06 11:23:12 +02:00
parent d45a0db6f3
commit dfed418ae2
2 changed files with 6 additions and 3 deletions

View File

@ -39,13 +39,16 @@ export class DossiersChangesService extends GenericService<Dossier> {
switchMap(dossierChanges =>
forkJoin([...load(dossierChanges), this.#dashboardStatsService.loadAll().pipe(take(1))]).pipe(map(() => dossierChanges)),
),
tap(() => this._updateLastChanged()),
);
}
hasChangesDetails$(): Observable<IDossierChanges> {
const body = { value: this._lastCheckedForChanges.get('root') };
return this._post<IDossierChanges>(body, `${this._defaultModelPath}/changes/details`).pipe(filter(changes => changes.length > 0));
const dateBeforeRequest = new Date().toISOString();
return this._post<IDossierChanges>(body, `${this._defaultModelPath}/changes/details`).pipe(
filter(changes => changes.length > 0),
tap(() => this._lastCheckedForChanges.set('root', dateBeforeRequest)),
);
}
initializeRefresh() {

@ -1 +1 @@
Subproject commit 33fb6b05252d32613af22d9bebae1cdde715badb
Subproject commit e21ca5059ecbd416de242f2564c731c7474c2e6c