Deletes a category.
function deleteCategory(categoryId: string): Promise<void>;
ID of category to be deleted.
import { categories } from "@wix/events";
// Sample categoryId value: "5fa9929d-6782-4927-9b8c-304ca9ca6e93"
export async function myDeleteCategoryFunction(categoryId) {
try {
const deletedCategory = await categories.deleteCategory(categoryId);
console.log("Category is deleted");
return deletedCategory;
} catch (error) {
console.error(error);
// Handle the error
}
}
/* Promise resolves to void */
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.