Fix backend to shared notes, and initial fronted code.

This commit is contained in:
Matias De lellis
2020-06-15 19:25:48 -03:00
parent 5f327bc136
commit c09c3aacb4
8 changed files with 126 additions and 63 deletions

View File

@@ -31,6 +31,22 @@ class NoteMapper extends QBMapper {
return $this->findEntity($qb);
}
/**
* @param int $id
* @throws \OCP\AppFramework\Db\DoesNotExistException if not found
* @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException if more than one result
* @return Note
*/
public function findShared($id) {
$qb = $this->db->getQueryBuilder();
$qb->select('*')
->from($this->tableName)
->where(
$qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT))
);
return $this->findEntity($qb);
}
public function findAll($userId) {
$qb = $this->db->getQueryBuilder();
$qb->select('*')