More work on hooks
This commit is contained in:
parent
392aa0d11f
commit
2a04cba42a
5 changed files with 164 additions and 4 deletions
19
node.go
19
node.go
|
|
@ -84,7 +84,24 @@ func GetNode(nodeID int) (node Node, err error) { // {{{
|
|||
) AS res
|
||||
)
|
||||
, '[]'::jsonb
|
||||
) AS ConnectedNodes
|
||||
) AS ConnectedNodes,
|
||||
|
||||
COALESCE(
|
||||
(
|
||||
SELECT jsonb_agg(res)
|
||||
FROM (
|
||||
SELECT
|
||||
h.id,
|
||||
to_jsonb(s) AS script,
|
||||
ssh
|
||||
FROM hook h
|
||||
INNER JOIN public.script s ON h.script_id = s.id
|
||||
WHERE
|
||||
h.node_id = n.id
|
||||
) AS res
|
||||
)
|
||||
, '[]'::jsonb
|
||||
) AS ScriptHooks
|
||||
|
||||
FROM public.node n
|
||||
INNER JOIN public.type t ON n.type_id = t.id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue