summaryrefslogtreecommitdiff
path: root/Handler/InventoryListing.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Handler/InventoryListing.hs')
-rw-r--r--Handler/InventoryListing.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Handler/InventoryListing.hs b/Handler/InventoryListing.hs
index d87512a..c61c62b 100644
--- a/Handler/InventoryListing.hs
+++ b/Handler/InventoryListing.hs
@@ -10,7 +10,7 @@ postInventoryListingR = do
10 10
11 case insertResult of 11 case insertResult of
12 FormSuccess (Item{..} `WithType` t) -> runDB $ do 12 FormSuccess (Item{..} `WithType` t) -> runDB $ do
13 upsertBy (UniqueKind itemNormKind) (Kind itemNormKind t) [ KindType =. t ] 13 void $ upsertBy (UniqueKind itemNormKind) (Kind itemNormKind t) [ KindType =. t ]
14 newItem <- insert Item{..} 14 newItem <- insert Item{..}
15 otherItems <- selectKeysList [ ItemNormKind ==. itemNormKind, ItemId !=. newItem ] [] 15 otherItems <- selectKeysList [ ItemNormKind ==. itemNormKind, ItemId !=. newItem ] []
16 when (not $ null otherItems) . addMessage "insertAmbiguous" $ 16 when (not $ null otherItems) . addMessage "insertAmbiguous" $
@@ -42,5 +42,5 @@ putInventoryListingR :: Handler Value
42putInventoryListingR = do 42putInventoryListingR = do
43 (Item{..} `WithType` t) <- requireCheckJsonBody 43 (Item{..} `WithType` t) <- requireCheckJsonBody
44 returnJson <=< runDB $ do 44 returnJson <=< runDB $ do
45 upsertBy (UniqueKind itemNormKind) (Kind itemNormKind t) [ KindType =. t ] 45 void $ upsertBy (UniqueKind itemNormKind) (Kind itemNormKind t) [ KindType =. t ]
46 withType =<< insertEntity Item{..} 46 withType =<< insertEntity Item{..}