Skip to content

Commit 10107cc

Browse files
authored
Merge pull request #568 from TechnologyEnhancedLearning/Develop/Fixes/LH-TD-4450-Unable-to-create-subfolders-for-newly-created-catalogues
TD-4450 : The problem with creating the subfolder has been resolved.
2 parents 2a5d639 + f2cd132 commit 10107cc

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/HierarchyEditFolderCreate.sql

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
-- 22-04-2024 DB Included NULL NodeId and UserId in call to [hierarchy].[FolderNodeVersionCreate].
1010
-- 15-05-2024 DB Accept @ParentNodePathId as input parameter, create NodePath and populate NodePathId and ParentNodePathId in HierarchyEditDetail.
1111
-- 10-07-2024 DB Added PrimaryCatalogueNodeId to the NodeVersion table.
12+
-- 04-09-2024 SA The problem with creating the subfolder has been resolved.
1213
-------------------------------------------------------------------------------
1314
CREATE PROCEDURE [hierarchy].[HierarchyEditFolderCreate]
1415
(
@@ -46,6 +47,24 @@ BEGIN
4647
AND HierarchyEditDetailTypeId = 4 -- Node Link
4748
AND Deleted = 0
4849

50+
-- Sub folder node creation (HierarchyEditDetailTypeId 3)
51+
52+
IF @ParentNodeId IS NULL
53+
BEGIN
54+
55+
SELECT @ParentNodeId = NodeId,
56+
@ParentNodePath = NodePath
57+
FROM hierarchy.NodePath
58+
WHERE Id = @ParentNodePathId
59+
AND Deleted = 0
60+
61+
SELECT TOP 1
62+
@PrimaryCatalogueNodeId = PrimaryCatalogueNodeId
63+
FROM hierarchy.HierarchyEditDetail
64+
WHERE HierarchyEditId = @HierarchyEditId
65+
AND Deleted = 0
66+
END
67+
4968
EXECUTE [hierarchy].[FolderNodeVersionCreate] NULL, @Name, @Description, @PrimaryCatalogueNodeId, @UserId, @CreatedNodeVersionId OUTPUT
5069

5170
SELECT @CreatedNodeId = NodeId FROM hierarchy.NodeVersion WHERE Id = @CreatedNodeVersionId

0 commit comments

Comments
 (0)