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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user