Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Przemyslaw Kaminski
haskell-gargantext
Commits
923c4bdf
Unverified
Commit
923c4bdf
authored
Jan 07, 2019
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the NgramsPatch type
parent
854cc11f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+4
-3
No files found.
src/Gargantext/API/Ngrams.hs
View file @
923c4bdf
...
...
@@ -163,6 +163,7 @@ instance ToSchema a => ToSchema (PatchSet a)
instance
ToSchema
a
=>
ToSchema
(
Replace
a
)
where
declareNamedSchema
(
_
::
proxy
(
Replace
a
))
=
do
-- TODO Keep constructor is not supported here.
aSchema
<-
declareSchemaRef
(
Proxy
::
Proxy
a
)
return
$
NamedSchema
(
Just
"Replace"
)
$
mempty
&
type_
.~
SwaggerObject
...
...
@@ -174,7 +175,7 @@ instance ToSchema a => ToSchema (Replace a) where
&
required
.~
[
"old"
,
"new"
]
data
NgramsPatch
=
NgramsPatch
{
_patch_children
::
PatchSet
Ngrams
Element
NgramsPatch
{
_patch_children
::
PatchSet
Ngrams
Term
,
_patch_list
::
Replace
ListType
-- TODO Map UserId ListType
}
deriving
(
Ord
,
Eq
,
Show
,
Generic
)
...
...
@@ -275,13 +276,13 @@ mkListsUpdate lId patches =
]
mkChildrenGroups
::
ListId
->
(
PatchSet
Ngrams
Element
->
Set
NgramsElement
)
->
(
PatchSet
Ngrams
Term
->
Set
NgramsTerm
)
->
NgramsTablePatch
->
[(
ListId
,
NgramsParent
,
NgramsChild
,
Maybe
Double
)]
mkChildrenGroups
lId
addOrRem
patches
=
[
(
lId
,
parent
,
child
,
Just
1
)
|
(
parent
,
patch
)
<-
patches
^..
ntp_ngrams_patches
.
ifolded
.
withIndex
,
child
<-
patch
^..
patch_children
.
to
addOrRem
.
folded
.
ne_ngrams
,
child
<-
patch
^..
patch_children
.
to
addOrRem
.
folded
]
-- Apply the given patch to the DB and returns the patch to be applied on the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment