Skip to content

Commit

Permalink
Add catalog ID check and fix missing MudPopoverProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Wilms committed Nov 14, 2024
1 parent 1228a82 commit 65a9f5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Nexus.UI/Routes.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
<MudThemeProvider Theme="_theme" />
<MudPopoverProvider />
<MudDialogProvider />
<MudSnackbarProvider />
</Found>
Expand Down
7 changes: 5 additions & 2 deletions src/Nexus/API/v1/CatalogsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -481,15 +481,18 @@ public Task<ActionResult<CatalogMetadata>>
/// <param name="metadata">The catalog metadata to set.</param>
/// <param name="cancellationToken">A token to cancel the current operation.</param>
[HttpPut("{catalogId}/metadata")]
public Task
public async Task<ActionResult<object>>
SetMetadataAsync(
string catalogId,
[FromBody] CatalogMetadata metadata,
CancellationToken cancellationToken)
{
if (metadata.Overrides?.Id != catalogId)
return (ActionResult<object>)UnprocessableEntity("The catalog ID does not match the ID of the catalog to update.");

catalogId = WebUtility.UrlDecode(catalogId);

var response = ProtectCatalogAsync<object>(catalogId, ensureReadable: false, ensureWritable: true, async catalogContainer =>
var response = await ProtectCatalogAsync<object>(catalogId, ensureReadable: false, ensureWritable: true, async catalogContainer =>
{
await catalogContainer.UpdateMetadataAsync(metadata);

Expand Down

0 comments on commit 65a9f5d

Please sign in to comment.