Allow manga +1 button to update both kitsu and mal

This commit is contained in:
Timothy Warren 2017-03-29 14:00:57 -04:00
parent ec7e0cc93b
commit 79980683d1
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,6 @@
_.on('.manga.list', 'click', '.edit_buttons button', (e) => {
let thisSel = e.target;
let parentSel = _.closestParent(e.target, 'article');
let mangaId = parentSel.id.replace('manga-', '');
let type = thisSel.classList.contains('plus_one_chapter') ? 'chapter' : 'volume';
let completed = parseInt(_.$(`.${type}s_read`, parentSel)[0].textContent, 10);
let total = parseInt(_.$(`.${type}_count`, parentSel)[0].textContent, 10);
@ -20,7 +19,8 @@
// Setup the update data
let data = {
id: mangaId,
id: parentSel.dataset.kitsuId,
mal_id: parentSel.dataset.malId,
data: {
progress: completed
}

View File

@ -221,7 +221,7 @@ class Manga extends Controller {
*/
public function update()
{
if ($this->request->getHeader('content-type')[0] === 'application/json')
if (stripos($this->request->getHeader('content-type')[0], 'application/json') !== FALSE)
{
$data = Json::decode((string)$this->request->getBody());
}