Commit d3cb492f authored by Alexandre Delanoë's avatar Alexandre Delanoë

[No Bug] Commenting the bug of refresh page ids when reload.

parent dcefed67
...@@ -195,22 +195,22 @@ performAction (LoadData n) props state@(TableData table) = do ...@@ -195,22 +195,22 @@ performAction (LoadData n) props state@(TableData table) = do
performAction (ChangePageSize ps) props state@(TableData table) = do performAction (ChangePageSize ps) props state@(TableData table) = do
void $ modifyState $ changePageSize ps void $ modifyState $ changePageSize ps
performAction (LoadData nId) props state -- performAction (LoadData nId) props state
where -- where
nId = maybe 0 identity table.nodeId -- nId = maybe 0 identity table.nodeId
performAction (ChangePage p) props state@(TableData table) = do performAction (ChangePage p) props state@(TableData table) = do
void $ modifyState \(TableData td) -> TableData $ td { currentPage = p } void $ modifyState \(TableData td) -> TableData $ td { currentPage = p }
performAction (LoadData nId) props state -- performAction (LoadData nId) props state
where -- where
nId = maybe 0 identity table.nodeId -- nId = maybe 0 identity table.nodeId
loadPage :: CorpusTableData -> Aff (Either String CorpusTableData) loadPage :: CorpusTableData -> Aff (Either String CorpusTableData)
loadPage t@(TableData table) = do loadPage t@(TableData table) = do
logs "loading documents page: loadPage with Offset and limit" logs "loading documents page: loadPage with Offset and limit"
let limit = pageSizes2Int table.pageSize let limit = pageSizes2Int table.pageSize
let offset = limit * (table.currentPage +1) let offset = limit * (table.currentPage - 1)
res <- get $ toUrl Back (Children offset limit) $ maybe 0 identity table.nodeId res <- get $ toUrl Back (Children offset limit) $ maybe 0 identity table.nodeId
case res of case res of
...@@ -236,7 +236,6 @@ loadPage t@(TableData table) = do ...@@ -236,7 +236,6 @@ loadPage t@(TableData table) = do
, ngramCount : r.ngramCount , ngramCount : r.ngramCount
}) rs }) rs
toTableData :: Array DocumentsView -> CorpusTableData toTableData :: Array DocumentsView -> CorpusTableData
toTableData ds = TableData toTableData ds = TableData
{ rows : map (\d -> { row : d , delete : false}) ds { rows : map (\d -> { row : d , delete : false}) ds
......
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