Add button to edit publications on publication view page.
This commit is contained in:
@@ -40,7 +40,6 @@
|
||||
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
|
||||
<footer>
|
||||
<app-submit-button label="Save" [requestPending]="(isSaving$ | async) == true"></app-submit-button>
|
||||
<button type="button" class="secondary" (click)="goPreviousLocation()">
|
||||
|
||||
@@ -128,17 +128,16 @@ export class PublicationEditionService implements OnDestroy {
|
||||
const publication = this._publication;
|
||||
|
||||
this.isSavingSubject.next(true);
|
||||
setTimeout(() => this.isSavingSubject.next(false), 1500);
|
||||
// this.publicationRestService.update(publication)
|
||||
// .then(() => {
|
||||
// this.snackBar.open('Publication updated succesfully!', 'Close', { duration: 5000 });
|
||||
// this.router.navigate(['/home']);
|
||||
// })
|
||||
// .catch(error => {
|
||||
// const errorMessage = 'An error occured while saving publication modifications.';
|
||||
// console.error(errorMessage, error);
|
||||
// this.snackBar.open(errorMessage, 'Close', { duration: 5000 });
|
||||
// })
|
||||
// .finally(() => this.isSavingSubject.next(false));
|
||||
this.publicationRestService.update(publication)
|
||||
.then(() => {
|
||||
this.snackBar.open('Publication updated succesfully!', 'Close', { duration: 5000 });
|
||||
this.router.navigate(['/home']);
|
||||
})
|
||||
.catch(error => {
|
||||
const errorMessage = 'An error occured while saving publication modifications.';
|
||||
console.error(errorMessage, error);
|
||||
this.snackBar.open(errorMessage, 'Close', { duration: 5000 });
|
||||
})
|
||||
.finally(() => this.isSavingSubject.next(false));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user