| 1 |
<?php |
| 2 |
|
| 3 |
namespace SyncBasalam\Actions\Controller; |
| 4 |
|
| 5 |
use SyncBasalam\Services\VendorSyncPolicy; |
| 6 |
|
| 7 |
defined('ABSPATH') || exit; |
| 8 |
|
| 9 |
class RefreshVendorStatus extends ActionController |
| 10 |
{ |
| 11 |
public function __invoke() |
| 12 |
{ |
| 13 |
$vendorSyncPolicy = syncBasalamContainer()->get(VendorSyncPolicy::class); |
| 14 |
$vendorSyncPolicy->refresh(); |
| 15 |
$state = $vendorSyncPolicy->getFrontendState(false); |
| 16 |
|
| 17 |
if ($state['mode'] === VendorSyncPolicy::MODE_ACTIVE) { |
| 18 |
wp_send_json_success([ |
| 19 |
'message' => 'غرفه ش� |
| 20 |
ا فعال است و � |
| 21 |
حدودیتهای ه� |
| 22 |
گا� |
| 23 |
سازی برداشته شد.', |
| 24 |
'state' => $state, |
| 25 |
]); |
| 26 |
} |
| 27 |
|
| 28 |
wp_send_json_success([ |
| 29 |
'message' => 'غرفه ش� |
| 30 |
ا هنوز در باسلا� |
| 31 |
غیرفعال است.', |
| 32 |
'state' => $state, |
| 33 |
]); |
| 34 |
} |
| 35 |
} |
| 36 |
|