Verified Commit e084fc19 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[corpus] fix merge conflicts

parents 9413ca83 266248f8
Pipeline #7524 passed with stages
in 25 minutes and 48 seconds
...@@ -50,7 +50,6 @@ bundle.js ...@@ -50,7 +50,6 @@ bundle.js
# IDE specific # IDE specific
.idea/ .idea/
.vscode .vscode/
# parcel
.parcel-cache/ .parcel-cache/
#!/bin/bash #!/bin/bash
set -e
# To get infos # To get infos
# nix-shell -p nix-info --run --extra-experimental-features nix-command "nix-info -m" # nix-shell -p nix-info --run --extra-experimental-features nix-command "nix-info -m"
......
...@@ -420,16 +420,6 @@ loadCorpus { nodeId, session } = do ...@@ -420,16 +420,6 @@ loadCorpus { nodeId, session } = do
Left err -> pure $ Left err Left err -> pure $ Left err
Right (NodePoly { parentId: corpusId } :: NodePoly {}) -> do Right (NodePoly { parentId: corpusId } :: NodePoly {}) -> do
fetchCorpusNode session corpusId fetchCorpusNode session corpusId
-- (NodePoly {parentId: corpusId} :: NodePoly {}) <- get session nodePolyRoute
-- corpusNode <- get session $ corpusNodeRoute corpusId ""
-- defaultListIds <- (get session $ defaultListIdsRoute corpusId)
-- :: forall a. JSON.ReadForeign a => AffTableResult (NodePoly a)
-- case (A.head defaultListIds.docs :: Maybe (NodePoly HyperdataList)) of
-- Just (NodePoly { id: defaultListId }) ->
-- pure {corpusId, corpusNode, defaultListId}
-- Nothing ->
-- throwError $ error "Missing default list"
where where
nodePolyRoute = NodeAPI Corpus (Just nodeId) "" nodePolyRoute = NodeAPI Corpus (Just nodeId) ""
...@@ -470,17 +460,8 @@ fetchDefaultList session corpusId = do ...@@ -470,17 +460,8 @@ fetchDefaultList session corpusId = do
case (A.head defaultListIds.docs :: Maybe (NodePoly HyperdataList)) of case (A.head defaultListIds.docs :: Maybe (NodePoly HyperdataList)) of
Just (NodePoly { id: defaultListId }) -> Just (NodePoly { id: defaultListId }) ->
pure $ Right defaultListId pure $ Right defaultListId
Nothing -> do Nothing ->
let listNode = AddNodeValue { name: "List", nodeType: NodeList } pure $ Left $ CustomError "Missing default list"
eListIds <- addNode session corpusId $ listNode
case eListIds of
Left err -> pure $ Left err
Right listIds ->
case (A.head listIds :: Maybe Int) of
Nothing ->
pure $ Left $ CustomError "Missing default list"
Just listId ->
pure $ Right listId
where where
defaultListIdsRoute = Children NodeList 0 1 Nothing <<< Just defaultListIdsRoute = Children NodeList 0 1 Nothing <<< Just
......
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