Skip to content
Snippets Groups Projects
Commit 6682f2cb authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6497 CR Anmerkungen

parent 7a39ecc4
Branches
Tags
No related merge requests found
...@@ -9,10 +9,11 @@ import { PostfachFormService } from './postfach.formservice'; ...@@ -9,10 +9,11 @@ import { PostfachFormService } from './postfach.formservice';
describe('PostfachFormService', () => { describe('PostfachFormService', () => {
let formService: PostfachFormService; let formService: PostfachFormService;
const postfachService: Mock<PostfachService> = mock(PostfachService); let postfachService: Mock<PostfachService>;
const formBuilder: FormBuilder = new FormBuilder(); const formBuilder: FormBuilder = new FormBuilder();
beforeEach(() => { beforeEach(() => {
postfachService = mock(PostfachService);
formService = new PostfachFormService(formBuilder, useFromMock(postfachService)); formService = new PostfachFormService(formBuilder, useFromMock(postfachService));
}); });
......
...@@ -19,13 +19,17 @@ export class PostfachService { ...@@ -19,13 +19,17 @@ export class PostfachService {
public save(postfach: Postfach): Observable<StateResource<PostfachResource>> { public save(postfach: Postfach): Observable<StateResource<PostfachResource>> {
return this.postfachResourceService.save(this.buildPostfachSettingItem(postfach)).pipe( return this.postfachResourceService.save(this.buildPostfachSettingItem(postfach)).pipe(
tap((stateResource: StateResource<PostfachResource>) => { tap((stateResource: StateResource<PostfachResource>) =>
this.showInfoAfterSave(stateResource),
),
startWith(createEmptyStateResource<PostfachResource>(true)),
);
}
private showInfoAfterSave(stateResource: StateResource<PostfachResource>) {
if (!stateResource.loading) { if (!stateResource.loading) {
this.snackbarService.showInfo('Die Signatur wird erfolgreich gespeichert.'); this.snackbarService.showInfo('Die Signatur wird erfolgreich gespeichert.');
} }
}),
startWith(createEmptyStateResource<PostfachResource>(true)),
);
} }
private buildPostfachSettingItem(postfach: Postfach): PostfachSettingsItem { private buildPostfachSettingItem(postfach: Postfach): PostfachSettingsItem {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment