Skip to content

Commit

Permalink
Fix RecordController render method to handle workspace record type wi…
Browse files Browse the repository at this point in the history
…thout redirect
  • Loading branch information
alejandro-bulgaris-qcif committed Jul 22, 2024
1 parent 51510f5 commit cbf8f0c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions typescript/api/controllers/RecordController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1340,8 +1340,16 @@ export module Controllers {

public render(req, res) {
const recordType = req.param('recordType') ? req.param('recordType') : '';
const packageType = req.param('packageType') ? req.param('packageType') : '';
const titleLabel = req.param('titleLabel') ? TranslationService.t(req.param('titleLabel')) : `${TranslationService.t('edit-dashboard')} ${TranslationService.t(recordType + '-title-label')}`;
let packageType = req.param('packageType') ? req.param('packageType') : '';
let titleLabel = req.param('titleLabel') ? TranslationService.t(req.param('titleLabel')) : `${TranslationService.t('edit-dashboard')} ${TranslationService.t(recordType + '-title-label')}`;
if(recordType == 'workspace') {
if(packageType == '') {
packageType = 'workspace';
}
if(titleLabel == '') {
titleLabel = 'workspaces';
}
}
return this.sendView(req, res, 'dashboard', { recordType: recordType, packageType: packageType, titleLabel: titleLabel });
}

Expand Down

0 comments on commit cbf8f0c

Please sign in to comment.