Add support for deleting event themes

This commit introduces functionality to delete event themes via the API. It includes type definitions, SDK methods, and a React Query mutation for `deleteEventTheme`. Users can perform both soft and hard deletes with this implementation.
This commit is contained in:
2025-03-12 15:22:03 +01:00
parent 1abc4a743a
commit e2265573eb
3 changed files with 79 additions and 0 deletions

View File

@@ -31,6 +31,8 @@ import type {
CreateEventThemeData,
CreateEventThemeResponse,
CreateEventThemeError,
DeleteEventThemeData,
DeleteEventThemeError,
GetEventThemeData,
GetEventThemeResponse,
GetEventThemeError,
@@ -287,6 +289,29 @@ export const createEventTheme = <ThrowOnError extends boolean = false>(
});
};
/**
* Delete Theme
* Delete specific theme by ID.
*/
export const deleteEventTheme = <ThrowOnError extends boolean = false>(
options: Options<DeleteEventThemeData, ThrowOnError>,
) => {
return (options.client ?? _heyApiClient).delete<
unknown,
DeleteEventThemeError,
ThrowOnError
>({
security: [
{
scheme: "bearer",
type: "http",
},
],
url: "/api/v1/event_themes/{theme_id}",
...options,
});
};
/**
* Get Theme
* Get specific theme by ID.