Correct Xero token DB saving
This commit is contained in:
parent
ec4fcd3fc8
commit
74ebb9d61a
1 changed files with 2 additions and 7 deletions
|
@ -273,13 +273,8 @@ upsertToken t = do
|
|||
let token = val t
|
||||
case token of
|
||||
Doc d -> do
|
||||
if isJust (t_id t)
|
||||
then do
|
||||
upsert (select ["address" =: t_address t] "xerotokens") d
|
||||
findOne (select ["address" =: t_address t] "xerotokens")
|
||||
else do
|
||||
insert_ "xerotokens" d
|
||||
findOne (select ["address" =: t_address t] "xerotokens")
|
||||
_ -> return Nothing
|
||||
|
||||
findToken :: T.Text -> Action IO (Maybe Document)
|
||||
|
|
Loading…
Reference in a new issue