Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
160
Issues
160
List
Board
Labels
Milestones
Merge Requests
14
Merge Requests
14
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
gargantext
haskell-gargantext
Commits
d4a9200e
Verified
Commit
d4a9200e
authored
Oct 09, 2024
by
Przemyslaw Kaminski
3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ws] notification action on node share
parent
5623161c
Pipeline
#6797
passed with stages
in 39 minutes and 49 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
Share.hs
src/Gargantext/Database/Action/Share.hs
+19
-9
No files found.
src/Gargantext/Database/Action/Share.hs
View file @
d4a9200e
...
...
@@ -18,6 +18,7 @@ module Gargantext.Database.Action.Share
import
Control.Arrow
(
returnA
)
import
Control.Lens
(
view
)
import
Gargantext.Core.AsyncUpdates.CentralExchange.Types
qualified
as
CE
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Database
import
Gargantext.Database.Action.User
(
getUserId
)
...
...
@@ -104,10 +105,14 @@ shareNodeWith (ShareNodeWith_User NodeFolderShared u) n = do
then
errorWith
"[G.D.A.S.shareNodeWith] Can share to others only"
else
do
folderSharedId
<-
getFolderId
u
NodeFolderShared
insertDB
([
NodeNode
{
_nn_node1_id
=
folderSharedId
,
_nn_node2_id
=
n
,
_nn_score
=
Nothing
,
_nn_category
=
Nothing
}]
::
[
NodeNode
])
ret
<-
insertDB
([
NodeNode
{
_nn_node1_id
=
folderSharedId
,
_nn_node2_id
=
n
,
_nn_score
=
Nothing
,
_nn_category
=
Nothing
}]
::
[
NodeNode
])
void
$
CE
.
ce_notify
$
CE
.
UpdateTreeFirstLevel
folderSharedId
void
$
CE
.
ce_notify
$
CE
.
UpdateTreeFirstLevel
n
return
ret
shareNodeWith
(
ShareNodeWith_Node
NodeFolderPublic
nId
)
n
=
do
nodeToCheck
<-
getNode
n
...
...
@@ -117,11 +122,16 @@ shareNodeWith (ShareNodeWith_Node NodeFolderPublic nId) n = do
else
do
folderToCheck
<-
getNode
nId
if
hasNodeType
folderToCheck
NodeFolderPublic
then
insertDB
([
NodeNode
{
_nn_node1_id
=
nId
,
_nn_node2_id
=
n
,
_nn_score
=
Nothing
,
_nn_category
=
Nothing
}]
::
[
NodeNode
])
else
errorWith
"[G.D.A.S.shareNodeWith] Can share NodeWith NodeFolderPublic only"
then
do
ret
<-
insertDB
([
NodeNode
{
_nn_node1_id
=
nId
,
_nn_node2_id
=
n
,
_nn_score
=
Nothing
,
_nn_category
=
Nothing
}]
::
[
NodeNode
])
void
$
CE
.
ce_notify
$
CE
.
UpdateTreeFirstLevel
nId
void
$
CE
.
ce_notify
$
CE
.
UpdateTreeFirstLevel
n
return
ret
else
errorWith
"[G.D.A.S.shareNodeWith] Can share NodeWith NodeFolderPublic only"
shareNodeWith
_
_
=
errorWith
"[G.D.A.S.shareNodeWith] Not implemented for this NodeType"
...
...
Przemyslaw Kaminski
@cgenie
mentioned in commit
b2a6b741
·
Oct 15, 2024
mentioned in commit
b2a6b741
mentioned in commit b2a6b741867406d05ac346f9c6720d6de297caf9
Toggle commit list
Przemyslaw Kaminski
@cgenie
mentioned in commit
84a773b4
·
Oct 16, 2024
mentioned in commit
84a773b4
mentioned in commit 84a773b4b001adde02d6543c0ed7d16acd289079
Toggle commit list
Przemyslaw Kaminski
@cgenie
mentioned in commit
83c8708f
·
Nov 07, 2024
mentioned in commit
83c8708f
mentioned in commit 83c8708f08e563243a0ff361e51a46c7d7822bb7
Toggle commit list
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