mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
refactor profile module
This commit is contained in:
parent
3077d105da
commit
76200f50c5
@ -11,7 +11,6 @@ use Rinvex\Subscriptions\Models\Plan;
|
||||
use Rinvex\Subscriptions\Models\PlanSubscription;
|
||||
use Visiosoft\AdvsModule\Adv\AdvModel;
|
||||
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
|
||||
use Visiosoft\AdvsModule\Adv\Event\ChangeStatusAd;
|
||||
use Visiosoft\LocationModule\Country\CountryModel;
|
||||
use Visiosoft\AlgoliaModule\Search\SearchModel;
|
||||
use Visiosoft\CloudsiteModule\CloudsiteModule;
|
||||
@ -96,11 +95,11 @@ class MyProfileController extends PublicController
|
||||
}
|
||||
}
|
||||
|
||||
public function statusAds($id, $type, SettingRepositoryInterface $settings, Dispatcher $events, AdvModel $advModel)
|
||||
public function statusAds($id, $type, Dispatcher $events, AdvModel $advModel)
|
||||
{
|
||||
$ad = $advModel->getAdv($id);
|
||||
$auto_approved = $settings->value('visiosoft.module.advs::auto_approve');
|
||||
$default_published_time = $settings->value('visiosoft.module.advs::default_published_time');
|
||||
$auto_approved = setting_value('visiosoft.module.advs::auto_approve');
|
||||
$default_published_time = setting_value('visiosoft.module.advs::default_published_time');
|
||||
|
||||
if ($auto_approved == true AND $type == 'pending_admin') {
|
||||
$type = "approved";
|
||||
@ -123,10 +122,9 @@ class MyProfileController extends PublicController
|
||||
$isActiveAlgolia = $isActiveAlgolia->is_enabled('algolia');
|
||||
if ($isActiveAlgolia) {
|
||||
$algolia = new SearchModel();
|
||||
$algolia->updateStatus($id, $type, $settings);
|
||||
$algolia->updateStatus($id, $type);
|
||||
}
|
||||
$status = $advModel->statusAds($id, $type);
|
||||
$events->dispatch(new ChangeStatusAd($id, $settings));//Create Notify
|
||||
|
||||
return response()->json(['status' => $status]);
|
||||
|
||||
@ -246,4 +244,9 @@ class MyProfileController extends PublicController
|
||||
return response()->json(['status' => 'success', 'data' => $profile]);
|
||||
}
|
||||
|
||||
public function checkUser()
|
||||
{
|
||||
return \auth()->check() ? ['success' => true] : ['success' => false];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -144,6 +144,8 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
|
||||
|
||||
// Cache links
|
||||
'ajax/get-user-info' => 'Visiosoft\ProfileModule\Http\Controller\CacheController@getUserInfo',
|
||||
|
||||
'check-user' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@checkUser',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user