Merge pull request #342 from eikek/fix-save-existing-tag

Fix save existing tag
This commit is contained in:
mergify[bot] 2020-10-18 22:46:20 +00:00 committed by GitHub
commit b56a94f9eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -32,7 +32,7 @@ case class Column(name: String, ns: String = "", alias: String = "") {
def is[A: Put](ov: Option[A]): Fragment =
ov match {
case Some(v) => f ++ fr" = $v"
case None => fr"is null"
case None => f ++ fr"is null"
}
def is(c: Column): Fragment =

View File

@ -69,7 +69,7 @@ object RTag {
val sql = selectCount(
tid,
table,
and(cid.is(tag.collective), name.is(tag.name), category.is(tag.category))
and(cid.is(tag.collective), name.is(tag.name))
)
sql.query[Int].unique.map(_ > 0)
}

View File

@ -300,12 +300,20 @@ update flags msg model =
)
SubmitResp (Ok res) ->
let
ret =
if res.success then
Just (makeValue model.form)
else
Nothing
in
( { model
| result = Just res
, submitting = False
}
, Cmd.none
, Just (makeValue model.form)
, ret
)
SubmitResp (Err err) ->