import { updateFavorites } from "~/store/favorites/favorites-actions";
import { snackbarActions } from "~/store/snackbar/snackbar-actions";
import { updateResources } from "~/store/resources/resources-actions";
+import { progressIndicatorActions } from "~/store/progress-indicator/progress-indicator-actions";
export class TrashPanelMiddlewareService extends DataExplorerMiddlewareService {
constructor(private services: ServiceRepository, id: string) {
}
try {
+ api.dispatch(progressIndicatorActions.START(this.getId()));
const userUuid = this.services.authService.getUuid()!;
const listResults = await this.services.groupsService
.contents(userUuid, {
recursive: true,
includeTrash: true
});
+ api.dispatch(progressIndicatorActions.PERSIST_STOP(this.getId()));
const items = listResults.items.map(it => it.uuid);
api.dispatch<any>(updateFavorites(items));
api.dispatch(updateResources(listResults.items));
} catch (e) {
+ api.dispatch(progressIndicatorActions.PERSIST_STOP(this.getId()));
api.dispatch(couldNotFetchTrashContents());
}
}