Skip to content

Commit

Permalink
configuration: add action parameter on redirectUrl
Browse files Browse the repository at this point in the history
Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
  • Loading branch information
Garfield-fr committed Aug 4, 2021
1 parent caf7011 commit 9eb532e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export class DetailComponent implements OnInit, OnDestroy {
const navigateOptions = { relativeTo: this._route };
if (result === true) {
if (typeof element === 'object' && this._config.redirectUrl) {
this._config.redirectUrl(element).subscribe((redirect: string) => {
this._config.redirectUrl(element, 'delete').subscribe((redirect: string) => {
if (redirect !== null) {
redirectUrl = redirect;
}
Expand Down
2 changes: 1 addition & 1 deletion projects/rero/ng-core/src/lib/record/record-ui.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class RecordUiService {
redirectAfterSave(pid: string, record: any, recordType: string, action: string, route: ActivatedRoute) {
const config = this.getResourceConfig(recordType);
if (config.redirectUrl) {
config.redirectUrl(record).subscribe((result: string) => {
config.redirectUrl(record, action).subscribe((result: string) => {
if (result !== null) {
this._router.navigate([result]);
return;
Expand Down

0 comments on commit 9eb532e

Please sign in to comment.