function createCategory
createCategory(req: CreateCategoryRequest): Category

Creates a category, for POST /api/categories. The name is stored trimmed, and the position defaults to 0. Every client is told to fetch the categories again, as after the two writes below.

Parameters

Return Type

Throws

APIException

400 when the slug or name is invalid, 409 when either is taken within its kind.

Usage

import { createCategory } from "api/services/category-service.ts";