mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-03-25 16:45:05 +00:00
Merge pull request #342 from eikek/fix-save-existing-tag
Fix save existing tag
This commit is contained in:
commit
b56a94f9eb
@ -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 =
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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) ->
|
||||
|
Loading…
x
Reference in New Issue
Block a user