Commit bcdff0bb authored by Karen Konou's avatar Karen Konou

[Subcorpus] Warn on missing corpus ID

parent 514b4eee
Pipeline #7316 passed with stages
in 26 minutes and 7 seconds
...@@ -188,10 +188,13 @@ docViewCpt = R2.hereComponent here "docView" hCpt ...@@ -188,10 +188,13 @@ docViewCpt = R2.hereComponent here "docView" hCpt
liftEffect $ liftEffect $
T.write_ true onSubcorpusCreationPending T.write_ true onSubcorpusCreationPending
res <- createSubCorpus session (fromMaybe 0 mCorpusId) $ SubcorpusParams { query: q, reuseParentList: p } case mCorpusId of
Nothing -> liftEffect $ here.warn2 "[docsTable subCorpusButton RESTError]" mCorpusId
Just cId -> do
res <- createSubCorpus session cId $ SubcorpusParams { query: q, reuseParentList: p }
liftEffect $ do liftEffect $ do
case res of case res of
Left err -> here.warn2 "[docsTable subSorpusButton RESTError]" err Left err -> here.warn2 "[docsTable subCorpusButton RESTError]" err
Right id -> do Right id -> do
T2.reload reloadForest T2.reload reloadForest
goToRoute $ Routes.Corpus (sessionId session) id goToRoute $ Routes.Corpus (sessionId session) id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment