diff --git a/src/Nexus.UI/Routes.razor b/src/Nexus.UI/Routes.razor index fc85c47b..36757b76 100644 --- a/src/Nexus.UI/Routes.razor +++ b/src/Nexus.UI/Routes.razor @@ -3,6 +3,7 @@ + diff --git a/src/Nexus/API/v1/CatalogsController.cs b/src/Nexus/API/v1/CatalogsController.cs index c4cc7909..1cefd2a2 100644 --- a/src/Nexus/API/v1/CatalogsController.cs +++ b/src/Nexus/API/v1/CatalogsController.cs @@ -481,15 +481,18 @@ public Task> /// The catalog metadata to set. /// A token to cancel the current operation. [HttpPut("{catalogId}/metadata")] - public Task + public async Task> SetMetadataAsync( string catalogId, [FromBody] CatalogMetadata metadata, CancellationToken cancellationToken) { + if (metadata.Overrides?.Id != catalogId) + return (ActionResult)UnprocessableEntity("The catalog ID does not match the ID of the catalog to update."); + catalogId = WebUtility.UrlDecode(catalogId); - var response = ProtectCatalogAsync(catalogId, ensureReadable: false, ensureWritable: true, async catalogContainer => + var response = await ProtectCatalogAsync(catalogId, ensureReadable: false, ensureWritable: true, async catalogContainer => { await catalogContainer.UpdateMetadataAsync(metadata);