Skip to content

Commit

Permalink
Merge pull request #66 from Lombiq/issue/OSOE-867
Browse files Browse the repository at this point in the history
OSOE-867: Addressing analyzer warnings
  • Loading branch information
Piedone authored Jun 11, 2024
2 parents b30fcfd + eea6302 commit 4443fe4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public async Task<ActionResult> Index()
[ValidateAntiForgeryToken]
public async Task<ActionResult> IndexPost(MediaThemeSettingsViewModel viewModel)
{
if (!ModelState.IsValid) return BadRequest(ModelState);

if (!await IsAuthorizedToManageMediaThemeAsync()) return NotFound();

var state = await _mediaThemeStateStore.LoadMediaThemeStateAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ public Task<IEnumerable<Permission>> GetPermissionsAsync() =>
.AsEnumerable());

public IEnumerable<PermissionStereotype> GetDefaultStereotypes() =>
new[]
{
[
new PermissionStereotype
{
Name = "Administrator",
Permissions = new[] { ManageMediaTheme },
Permissions = [ManageMediaTheme],
},
};
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public async Task UpdateBaseThemeAsync(string baseThemeId)
var baseThemeFeature = (await _shellFeaturesManager.GetAvailableFeaturesAsync())
.FirstOrDefault(feature => feature.IsTheme() && feature.Id == baseThemeId)
?? throw new ArgumentException($"Theme with the given ID ({baseThemeId}) doesn't exist.", nameof(baseThemeId));
await _shellFeaturesManager.EnableFeaturesAsync(new[] { baseThemeFeature }, force: true);
await _shellFeaturesManager.EnableFeaturesAsync([baseThemeFeature], force: true);
}

var state = await _mediaThemeStateStore.LoadMediaThemeStateAsync();
Expand Down

0 comments on commit 4443fe4

Please sign in to comment.