mirror of
https://github.com/moparisthebest/wallabag
synced 2024-12-25 00:38:51 -05:00
[add] api code for mark as unread
This commit is contained in:
parent
31a52d03d1
commit
17086fa3bd
@ -23,6 +23,10 @@ class EntryApi
|
||||
return $this->entryRepository->markAsRead($id);
|
||||
}
|
||||
|
||||
public function markAsUnread($id) {
|
||||
return $this->entryRepository->markAsUnread($id);
|
||||
}
|
||||
|
||||
public function createEntryFromUrl($url) {
|
||||
|
||||
//TODO: Fetch all what we need, fill the title, content …
|
||||
|
@ -39,5 +39,13 @@ class EntryRepository
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
//TODO don't hardcode the user ;)
|
||||
public function markAsUnread($id, $userId = 1) {
|
||||
$sql = "UPDATE entries SET status = 'unread' where id = ? AND user_id = ?";
|
||||
$count = $this->db->executeUpdate($sql, array($id, $userId));
|
||||
|
||||
return $count;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user