Skip to content

Commit

Permalink
Customer website
Browse files Browse the repository at this point in the history
  • Loading branch information
itzArtha committed Oct 6, 2023
1 parent a26790e commit 06cda21
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
];
}
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -75,4 +72,4 @@ const handleRadioChanged = async (itemId: number, itemValue: string, itemSlug: s
</div>
</div>
</div>
</template>
</template>
2 changes: 1 addition & 1 deletion routes/org/web/models.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 06cda21

Please sign in to comment.