Delete categoryv1.0.0 · JSON Schema
Deletes an existing category from the Catalog.
1. Delete a Category by UUID
A backoffice catalog manager removes a category record (DELETE /api/v1/categories/{id}).
Payload details
id: Required category UUID passed as the route parameter.- Request body: None.
Using this example
Returns 204 No Content and removes the category record from Catalog API.
using BookWorm.Chassis.Utilities.Configurations;using BookWorm.Constants.Aspire;using Refit;
public interface ICatalogApiClient{ [Delete("/api/v1/categories/{id}")] Task DeleteCategoryAsync(Guid id, CancellationToken cancellationToken = default);}
// DI registration following BookWorm.Chassis Refit patternbuilder.Services .AddRefitGeneratedClient<ICatalogApiClient>(settings, Services.Catalog) .ConfigureHttpClient(client => client.BaseAddress = new($"https+http://{Services.Catalog}")) .ConfigurePrimaryHttpMessageHandler(() => new SocketsHttpHandler { PooledConnectionLifetime = TimeSpan.FromMinutes(5) } );
// Typed invocationawait catalogApiClient.DeleteCategoryAsync( Guid.Parse("01960a1b-1000-7000-8a9b-0c1d2e3f4a01"), cancellationToken);import categoriesApiClient from "@workspace/api-client/catalog/categories";import useDeleteCategory from "@workspace/api-hooks/catalog/categories/useDeleteCategory";
const categoryId = "01960a1b-1000-7000-8a9b-0c1d2e3f4a01";
// 1. Direct @workspace/api-client (Axios) callawait categoriesApiClient.delete(categoryId);
// 2. React / TanStack Query hook (@workspace/api-hooks)const { mutate: deleteCategory, isPending } = useDeleteCategory({ onSuccess: () => { console.log(`Deleted category ${categoryId}`); },});
deleteCategory(categoryId);1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "title": "DeleteCategory",
4 "description": "Path identifier for the category to delete.",
5 "type": "string",
6 "format": "uuid"
7}
8