Fix numeric types and missing card id in card detail results

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2018-12-07 17:02:18 +01:00
parent 082346b9e9
commit ec42c0c2b4
3 changed files with 11 additions and 9 deletions

View File

@@ -33,8 +33,8 @@ class AssignedUsers extends RelationalEntity implements JsonSerializable {
public function __construct() { public function __construct() {
$this->addType('id', 'integer'); $this->addType('id', 'integer');
$this->addType('card_id', 'integer'); $this->addType('cardId', 'integer');
$this->addResolvable('participant'); $this->addResolvable('participant');
} }
} }

View File

@@ -5,20 +5,20 @@
* @author Julius Härtl <jus@bitgrid.net> * @author Julius Härtl <jus@bitgrid.net>
* *
* @license GNU AGPL version 3 or any later version * @license GNU AGPL version 3 or any later version
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
namespace OCA\Deck\Db; namespace OCA\Deck\Db;
@@ -29,8 +29,10 @@ class Label extends RelationalEntity {
protected $color; protected $color;
protected $boardId; protected $boardId;
protected $cardId; protected $cardId;
public function __construct() { public function __construct() {
$this->addType('id', 'integer'); $this->addType('id', 'integer');
$this->addType('boardId', 'integer');
$this->addType('cardId', 'integer');
} }
} }

View File

@@ -45,7 +45,7 @@ class LabelMapper extends DeckMapper implements IPermissionMapper {
} }
public function findAssignedLabelsForCard($cardId, $limit = null, $offset = null) { public function findAssignedLabelsForCard($cardId, $limit = null, $offset = null) {
$sql = 'SELECT l.* FROM `*PREFIX*deck_assigned_labels` as al INNER JOIN *PREFIX*deck_labels as l ON l.id = al.label_id WHERE `card_id` = ? ORDER BY l.id'; $sql = 'SELECT l.*,card_id FROM `*PREFIX*deck_assigned_labels` as al INNER JOIN *PREFIX*deck_labels as l ON l.id = al.label_id WHERE `card_id` = ? ORDER BY l.id';
return $this->findEntities($sql, [$cardId], $limit, $offset); return $this->findEntities($sql, [$cardId], $limit, $offset);
} }
public function findAssignedLabelsForBoard($boardId, $limit = null, $offset = null) { public function findAssignedLabelsForBoard($boardId, $limit = null, $offset = null) {