Allow regular users to unlink tags from photos.

This commit is contained in:
2019-03-09 13:48:18 +01:00
parent 05c48be785
commit 42e5c7fe37
3 changed files with 61 additions and 9 deletions

View File

@@ -98,8 +98,19 @@ class ViewPhoto extends HTMLController
}
// We are!
$photo->linkTags([(int) $_POST['id_tag']]);
echo json_encode(['success' => true]);
exit;
if (!isset($_POST['delete']))
{
$photo->linkTags([(int) $_POST['id_tag']]);
echo json_encode(['success' => true]);
exit;
}
// ... deleting, that is.
else
{
$photo->unlinkTags([(int) $_POST['id_tag']]);
echo json_encode(['success' => true]);
exit;
}
}
}