fix removing manga from library not working

This commit is contained in:
Aria Moradi 2021-02-20 02:34:26 +03:30
parent 162961b560
commit 2bbebe4c30
2 changed files with 1 additions and 2 deletions

View File

@ -166,7 +166,6 @@ class Main {
// removes the manga from the library
app.delete("api/v1/manga/:mangaId/library") { ctx ->
val mangaId = ctx.pathParam("mangaId").toInt()
println("fuck")
removeMangaFromLibrary(mangaId)
ctx.status(200)
}

View File

@ -25,7 +25,7 @@ fun addMangaToLibrary(mangaId: Int) {
fun removeMangaFromLibrary(mangaId: Int) {
val manga = getManga(mangaId)
if (!manga.inLibrary) {
if (manga.inLibrary) {
transaction {
MangaTable.update({ MangaTable.id eq manga.id }) {
it[inLibrary] = false