1
0
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:
Nicolas Lœuillet 2014-01-09 22:10:05 +01:00
parent 31a52d03d1
commit 17086fa3bd
2 changed files with 12 additions and 0 deletions

View File

@ -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 …

View File

@ -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;
}
}