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
# IDE specific
.idea/
.vscode
.vscode/
# parcel
.parcel-cache/
#!/bin/bash
set -e
# To get infos
# nix-shell -p nix-info --run --extra-experimental-features nix-command "nix-info -m"
......
......@@ -420,16 +420,6 @@ loadCorpus { nodeId, session } = do
Left err -> pure $ Left err
Right (NodePoly { parentId: corpusId } :: NodePoly {}) -> do
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
nodePolyRoute = NodeAPI Corpus (Just nodeId) ""
......@@ -470,17 +460,8 @@ fetchDefaultList session corpusId = do
case (A.head defaultListIds.docs :: Maybe (NodePoly HyperdataList)) of
Just (NodePoly { id: defaultListId }) ->
pure $ Right defaultListId
Nothing -> do
let listNode = AddNodeValue { name: "List", nodeType: NodeList }
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
Nothing ->
pure $ Left $ CustomError "Missing default list"
where
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