All in GraphQL #34

Merged
timw4mail merged 87 commits from develop into master 2020-12-01 10:07:49 -05:00
2 changed files with 16 additions and 5 deletions
Showing only changes of commit 238a423806 - Show all commits

View File

@ -32,7 +32,7 @@
<td>
<select name="watching_status" id="watching_status">
<?php foreach($statuses as $status_key => $status_title): ?>
<option <?php if($item['watching_status'] === $status_key): ?>selected="selected"<?php endif ?>
<option <?php if(strtolower($item['watching_status']) === $status_key): ?>selected="selected"<?php endif ?>
value="<?= $status_key ?>"><?= $status_title ?></option>
<?php endforeach ?>
</select>

View File

@ -143,16 +143,27 @@ final class ListItem extends AbstractListItem {
*/
public function update(string $id, FormItemData $data): Request
{
return $this->requestBuilder->mutateRequest('UpdateLibraryItem', [
// Data to always send
$updateData = [
'id' => $id,
'notes' => $data['notes'],
'private' => (bool)$data['private'],
'progress' => (int)$data['progress'],
'ratingTwenty' => (int)$data['ratingTwenty'],
'reconsumeCount' => (int)$data['reconsumeCount'],
'reconsuming' => (bool)$data['reconsuming'],
'status' => strtoupper($data['status']),
]);
];
// Only send these variables if they have a value
if ($data['progress'] !== NULL)
{
$updateData['progress'] = (int)$data['progress'];
}
if ($data['ratingTwenty'] !== NULL)
{
$updateData['ratingTwenty'] = (int)$data['ratingTwenty'];
}
return $this->requestBuilder->mutateRequest('UpdateLibraryItem', $updateData);
}
/**