Add UFVK support for ZGo shops
This commit is contained in:
parent
68285fbc39
commit
cd5af6b907
1 changed files with 16 additions and 1 deletions
|
@ -1189,7 +1189,22 @@ routes pipe config = do
|
|||
liftAndCatchIO $ run (upsertViewingKey o' q)
|
||||
status created201
|
||||
else status forbidden403
|
||||
else status badRequest400 -- TODO: add Unified VK support
|
||||
else case decodeUfvk (C.pack q) of
|
||||
Nothing -> status badRequest400
|
||||
Just fvk ->
|
||||
if matchOrchardAddress
|
||||
(C.pack q)
|
||||
(C.pack . T.unpack $ uaddress u')
|
||||
then do
|
||||
owner <-
|
||||
liftAndCatchIO $ run (findOwner $ uaddress u')
|
||||
case cast' . Doc =<< owner of
|
||||
Nothing -> status badRequest400
|
||||
Just o' -> do
|
||||
unless (oviewkey o' /= "") $ do
|
||||
liftAndCatchIO $ run (upsertViewingKey o' q)
|
||||
status created201
|
||||
else status forbidden403
|
||||
--Get items associated with the given address
|
||||
get "/api/items" $ do
|
||||
session <- param "session"
|
||||
|
|
Loading…
Reference in a new issue