deleteEnum
The deleteEnum function deletes an Enum model. It is the JavaScript/TypeScript counterpart of the DELETE /model/enum/:id REST endpoint.
Example:
import { isApiClientError } from '@content-island/api-client';
try { await client.deleteEnum(enumId); // resolves to `true` on success} catch (error) { if (isApiClientError(error) && error.code === 'CONFLICT') { // an entity field references this enum — repoint or remove that field first }}Interface
export interface ApiClient { deleteEnum: (enumId: string) => Promise<boolean>; // ... other methods}Parameters
| Name | Description |
|---|---|
enumId | The id of the enum to delete. |
Output
Resolves to true when the enum is deleted (HTTP 204). On failure it throws a typed
ApiClientError:
CONFLICT(409) — an entity field of typeenumreferences this enum. There is no force override; remove or repoint the referencing field first.NOT_FOUND(404) — no enum with that id exists.