Skip to content
Snippets Groups Projects
Commit 00a5a581 authored by Florent POITTEVIN's avatar Florent POITTEVIN
Browse files

fix: allow to see notification in detail

parent 243cd6c0
No related branches found
No related tags found
No related merge requests found
......@@ -154,6 +154,36 @@ export class PreservationSpaceNotificationState extends ResourceState<Preservati
);
}
@OverrideDefaultAction()
@Action(PreservationSpaceNotificationAction.GetById)
getById(ctx: StateContext<PreservationSpaceNotificationStateModel>, action: PreservationSpaceNotificationAction.GetById): Observable<NotificationDlcm> {
let reset = {};
if (!action.keepCurrentContext) {
reset = {
current: undefined,
};
}
ctx.patchState({
isLoadingCounter: ctx.getState().isLoadingCounter + 1,
...reset,
});
let mode = ApiActionEnum.INBOX;
if (ctx.getState().mode === NotificationModeEnum.sent) {
mode = ApiActionEnum.SENT;
}
return this.apiService.getById<NotificationDlcm>(this._urlResource + urlSeparator + mode, action.id)
.pipe(
tap((model: NotificationDlcm) => {
ctx.dispatch(new PreservationSpaceNotificationAction.GetByIdSuccess(action, model));
}),
catchError(error => {
ctx.dispatch(new PreservationSpaceNotificationAction.GetByIdFail(action));
throw new SolidifyStateError(this, error);
}),
);
}
@Action(PreservationSpaceNotificationAction.Accept)
accept(ctx: StateContext<PreservationSpaceNotificationStateModel>, action: PreservationSpaceNotificationAction.Accept): Observable<Result> {
return this.apiService.post<Result>(this._urlResource + urlSeparator + action.notificationId + urlSeparator + ApiActionEnum.ACCEPT)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment