Skip to content

Commit

Permalink
fix linting and can't define let outside if block
Browse files Browse the repository at this point in the history
  • Loading branch information
Monkeychip committed Oct 3, 2024
1 parent 8c40a00 commit 5a7ed4d
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions ui/app/components/transformation-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,22 @@ export default TransformBase.extend({
const updateOrCreateResponse = await this.updateOrCreateRole(record, transformationId, backend);
// If an error was returned, check error type and show a message.
const errorStatus = updateOrCreateResponse?.errorStatus;
if (errorStatus === 403) {
let message = `The edits to this transformation were successful, but transformations for the role ${record.id} were not edited due to a lack of permissions.`;
} else if (errorStatus) {
message = `You've edited the allowed_roles for this transformation. However, there was a problem updating the role: ${record.id}.`;
}
this.flashMessages.info(message, {
sticky: true,
priority: 300,
});
if (errorStatus == 403) {
this.flashMessages.info(
`The edits to this transformation were successful, but transformations for the role ${record.id} were not edited due to a lack of permissions.`,
{
sticky: true,
priority: 300,
}
);
} else if (errorStatus) {
this.flashMessages.info(
`You've edited the allowed_roles for this transformation. However, there was a problem updating the role: ${record.id}.`,
{
sticky: true,
priority: 300,
}
);
}
});
},
Expand Down

0 comments on commit 5a7ed4d

Please sign in to comment.