Fix Fever API bug: enable send bookmark to third-party services
This commit is contained in:
parent
14600c602d
commit
729c2bfb42
@ -1,3 +1,4 @@
|
|||||||
|
<IfModule mod_rewrite.c>
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
|
|
||||||
RewriteBase /
|
RewriteBase /
|
||||||
@ -11,3 +12,4 @@ RewriteRule ^.*$ - [E=CWD:%2]
|
|||||||
|
|
||||||
# Just by prefixing the environment variable, we can safely rewrite anything now
|
# Just by prefixing the environment variable, we can safely rewrite anything now
|
||||||
RewriteRule ^([^/]*) %{ENV:CWD}index.php?database=$1 [QSA,L]
|
RewriteRule ^([^/]*) %{ENV:CWD}index.php?database=$1 [QSA,L]
|
||||||
|
</IfModule>
|
@ -3,6 +3,7 @@
|
|||||||
require '../common.php';
|
require '../common.php';
|
||||||
|
|
||||||
use Model\Feed;
|
use Model\Feed;
|
||||||
|
use Model\Service;
|
||||||
use PicoDb\Database;
|
use PicoDb\Database;
|
||||||
|
|
||||||
// Route handler
|
// Route handler
|
||||||
@ -262,6 +263,14 @@ route('write_items', function() {
|
|||||||
|
|
||||||
if ($_POST['as'] === 'saved') {
|
if ($_POST['as'] === 'saved') {
|
||||||
$query->update(array('bookmark' => 1));
|
$query->update(array('bookmark' => 1));
|
||||||
|
|
||||||
|
// Send bookmark to third-party services if enabled
|
||||||
|
$item_id = Database::get('db')
|
||||||
|
->table('items')
|
||||||
|
->eq('rowid', $_POST['id'])
|
||||||
|
->findOneColumn('id');
|
||||||
|
|
||||||
|
Service\push($item_id);
|
||||||
}
|
}
|
||||||
else if ($_POST['as'] === 'unsaved') {
|
else if ($_POST['as'] === 'unsaved') {
|
||||||
$query->update(array('bookmark' => 0));
|
$query->update(array('bookmark' => 0));
|
||||||
|
Loading…
Reference in New Issue
Block a user