Closing #47 with completed manual trigger for social updates.

Moving update/import functionality back to the feed controller (removing the import controller previously created), added an option to the backend that triggers the update from the custom SocialApis class.
This commit is contained in:
Jason Williams
2020-12-30 20:05:29 -07:00
parent 3792846778
commit 2026e4a872
7 changed files with 87 additions and 41 deletions

View File

@@ -2,6 +2,7 @@
use Backend\Classes\Controller;
use BackendMenu;
use JasonWilliams\Feed\Classes\SocialApis;
class Feed extends Controller
{
@@ -18,4 +19,39 @@ class Feed extends Controller
parent::__construct();
BackendMenu::setContext('jasonwilliams.feed', 'main-menu-item');
}
public function import()
{
$this->pageTitle = 'Fetch posts';
}
public function onImportTwitter()
{
SocialApis::updateTwitter();
return $this->makePartial('import', [
'importType' => 'Twitter',
'content' => 'Done'
]);
}
public function onImportInstagram()
{
SocialApis::updateInstagram();
return $this->makePartial('import', [
'importType' => 'Instagram',
'content' => 'Done'
]);
}
public function onImportFoursquare()
{
SocialApis::updateFoursquare();
return $this->makePartial('import', [
'importType' => 'Foursquare',
'content' => 'Done'
]);
}
}