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
f126695c
Commit
f126695c
authored
Jan 25, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Contact Search
parent
2645c82e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
Search.hs
src/Gargantext/API/Search.hs
+11
-8
No files found.
src/Gargantext/API/Search.hs
View file @
f126695c
...
...
@@ -10,8 +10,6 @@ Portability : POSIX
Count API part of Gargantext.
-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DeriveAnyClass #-}
...
...
@@ -27,15 +25,17 @@ import Data.Time (UTCTime)
import
GHC.Generics
(
Generic
)
import
Gargantext.API.Prelude
(
GargServer
)
import
Gargantext.Core.Utils.Prefix
(
unPrefixSwagger
,
unCapitalize
,
dropPrefix
)
import
Gargantext.Database.Query.Facet
import
Gargantext.Database.Action.Search
import
Gargantext.Database.Action.Flow.Pairing
(
isPairedWith
)
import
Gargantext.Database.Action.Search
import
Gargantext.Database.Admin.Types.Hyperdata
(
HyperdataContact
(
..
),
HyperdataDocument
(
..
),
ContactWho
(
..
))
import
Gargantext.Database.Admin.Types.Hyperdata.Contact
(
_cw_organization
)
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Query.Facet
import
Gargantext.Prelude
import
Servant
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
import
qualified
Data.Text
as
Text
-----------------------------------------------------------------------
-- TODO-ACCESS: CanSearch? or is it part of CanGetNode
...
...
@@ -105,8 +105,7 @@ instance Arbitrary SearchQuery where
-- arbitrary = elements [SearchQuery "electrodes" 1 ] --SearchDoc]
-----------------------------------------------------------------------
data
SearchResult
=
SearchResult
{
result
::
!
SearchResultTypes
}
SearchResult
{
result
::
!
SearchResultTypes
}
|
SearchResultErr
!
Text
deriving
(
Generic
)
...
...
@@ -281,5 +280,9 @@ instance ToHyperdataRow HyperdataDocument where
(
fromMaybe
"EN"
l
)
instance
ToHyperdataRow
HyperdataContact
where
toHyperdataRow
(
HyperdataContact
_
(
Just
(
ContactWho
_
fn
ln
_
_
))
_
_
_
_
_
_
)
=
HyperdataRowContact
(
fromMaybe
"FN"
fn
)
(
fromMaybe
"LN"
ln
)
"Labs"
toHyperdataRow
(
HyperdataContact
_
_
_
_
_
_
_
_
)
=
HyperdataRowContact
"FirstName"
"LastName"
"Labs"
toHyperdataRow
(
HyperdataContact
_
(
Just
(
ContactWho
_
fn
ln
_
_
))
ou
_
_
_
_
_
)
=
HyperdataRowContact
(
fromMaybe
"FirstName"
fn
)
(
fromMaybe
"LastName"
ln
)
ou'
where
ou'
=
maybe
"IMT"
(
Text
.
intercalate
" "
.
_cw_organization
)
(
head
ou
)
toHyperdataRow
(
HyperdataContact
_
_
_
_
_
_
_
_
)
=
HyperdataRowContact
"FirstName"
"LastName"
"Labs"
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