diff --git a/app/Actions/Catalogue/ProductCategory/UpdateProductCategory.php b/app/Actions/Catalogue/ProductCategory/UpdateProductCategory.php index a1877f123..efa0596b6 100644 --- a/app/Actions/Catalogue/ProductCategory/UpdateProductCategory.php +++ b/app/Actions/Catalogue/ProductCategory/UpdateProductCategory.php @@ -44,6 +44,7 @@ public function rules(): array 'name' => ['sometimes', 'max:250', 'string'], 'image_id' => ['sometimes', 'required', 'exists:media,id'], 'state' => ['sometimes', 'required'], + 'interest' => ['sometimes', 'required'], 'description' => ['sometimes', 'required', 'max:1500'], ]; } @@ -58,7 +59,8 @@ public function action(ProductCategory $productCategory, array $objectData): Pro public function asController(ProductCategory $productCategory, ActionRequest $request): ProductCategory { - return $this->handle($productCategory, $request->all()); + $request->validate(); + return $this->handle($productCategory, $request->validated()); } public function jsonResponse(ProductCategory $productCategory): DepartmentResource diff --git a/database/migrations/2022_09_01_000010_create_product_categories_table.php b/database/migrations/2022_09_01_000010_create_product_categories_table.php index 549fe1da3..2a4ac9597 100644 --- a/database/migrations/2022_09_01_000010_create_product_categories_table.php +++ b/database/migrations/2022_09_01_000010_create_product_categories_table.php @@ -23,6 +23,7 @@ public function up(): void $table->string('type')->index(); $table->boolean('is_family')->default(false); $table->string('state')->nullable()->index(); + $table->string('interest')->nullable()->index(); $table->jsonb('data'); $table->timestampstz(); $table->softDeletesTz(); diff --git a/resources/js/Pages/Organisation/Portfolios/PortfolioWebsiteShowcase.vue b/resources/js/Pages/Organisation/Portfolios/PortfolioWebsiteShowcase.vue index 96eef2e0a..fe5dc42ae 100644 --- a/resources/js/Pages/Organisation/Portfolios/PortfolioWebsiteShowcase.vue +++ b/resources/js/Pages/Organisation/Portfolios/PortfolioWebsiteShowcase.vue @@ -14,9 +14,6 @@ const handleRadioChanged = async (itemId: number, itemValue: string, itemSlug: s route('org.models.product-category.update', itemSlug), { state: itemValue - }, - { - headers: { "Content-Type": "multipart/form-data" }, } ).then(data => { console.log(data) @@ -75,4 +72,4 @@ const handleRadioChanged = async (itemId: number, itemValue: string, itemSlug: s - \ No newline at end of file + diff --git a/routes/org/web/models.php b/routes/org/web/models.php index 543a99d0a..84518782e 100644 --- a/routes/org/web/models.php +++ b/routes/org/web/models.php @@ -82,7 +82,7 @@ Route::patch('/product/{product}', UpdateProduct::class)->name('product.update'); Route::delete('/product/{product}', UpdateProduct::class)->name('product.delete'); -Route::patch('/product-category/{productCategory}', UpdateProductCategory::class)->name('product-category.update'); +Route::patch('product-category/{productCategory}', UpdateProductCategory::class)->name('product-category.update'); Route::prefix('shop')->as('shop.')->group(function () { Route::post('', StoreShop::class)->name('store');