refactor(shop_category): migrate admin module to Domain+DI with routing and ajax cleanup

This commit is contained in:
2026-02-15 15:32:23 +01:00
parent e17875526d
commit 6c87e4615a
63 changed files with 8998 additions and 625 deletions

View File

@@ -4,8 +4,10 @@ $a = \S::get( 'a' );
if ( $a == 'save_products_order' )
{
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania kolejności wyświetlania produktów wystąpił błąd. Proszę spróbować ponownie.' ];
if ( \admin\factory\ShopCategory::save_product_order( \S::get( 'category_id' ), \S::get( 'products' ) ) )
$categoryRepository = new \Domain\Category\CategoryRepository( $mdb );
if ( $categoryRepository->saveProductOrder( \S::get( 'category_id' ), \S::get( 'products' ) ) )
$response = [ 'status' => 'ok' ];
echo json_encode( $response );

View File

@@ -16,8 +16,10 @@ if ( $a == 'cookie_categories' )
if ( $a == 'save_categories_order' )
{
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania kolejności kategorii wystąpił błąd. Proszę spróbować ponownie.' ];
if ( \admin\factory\ShopCategory::save_categories_order( \S::get( 'categories' ) ) )
$categoryRepository = new \Domain\Category\CategoryRepository( $mdb );
if ( $categoryRepository->saveCategoriesOrder( \S::get( 'categories' ) ) )
$response = [ 'status' => 'ok' ];
echo json_encode( $response );