Fix/add additionl data to product categories hook (#11226)

* fix: add additional_data to categoriesCreated hooks

* fix: restore yarn.lock

* fix: add additional_data param in the http validators

* fix: add additional_data to updateProductCategoriesWorkflow

* Update yarn.lock

* fix: fix merge

* fix: refert yarn.lock

* fix: revert tarn.lock

* Create clean-poets-promise.md

---------

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
This commit is contained in:
BOUAZZA Ayyoub
2025-02-26 14:58:01 +01:00
committed by GitHub
co-authored by Carlos R. L. Rodrigues Riqwan Thamir
parent 95eef899f7
commit 93cbc6b669
5 changed files with 38 additions and 16 deletions
@@ -7,6 +7,7 @@ import {
createFindParams,
createOperatorMap,
createSelectParams,
WithAdditionalData,
} from "../../utils/validators"
export type AdminProductCategoryParamsType = z.infer<
@@ -44,7 +45,7 @@ export const AdminProductCategoriesParams = createFindParams({
.merge(AdminProductCategoriesParamsFields)
.merge(applyAndAndOrOperators(AdminProductCategoriesParamsFields))
export const AdminCreateProductCategory = z
export const CreateProductCategory = z
.object({
name: z.string(),
description: z.string().optional(),
@@ -57,11 +58,15 @@ export const AdminCreateProductCategory = z
})
.strict()
export const AdminCreateProductCategory = WithAdditionalData(
CreateProductCategory
)
export type AdminCreateProductCategoryType = z.infer<
typeof AdminCreateProductCategory
typeof CreateProductCategory
>
export const AdminUpdateProductCategory = z
export const UpdateProductCategory = z
.object({
name: z.string().optional(),
description: z.string().optional(),
@@ -74,6 +79,10 @@ export const AdminUpdateProductCategory = z
})
.strict()
export const AdminUpdateProductCategory = WithAdditionalData(
UpdateProductCategory
)
export type AdminUpdateProductCategoryType = z.infer<
typeof AdminUpdateProductCategory
typeof UpdateProductCategory
>