Skip to content

Commit bc5d15d

Browse files
committed
Intial commit-Fix
1 parent fc01ec7 commit bc5d15d

File tree

10 files changed

+33
-34
lines changed

10 files changed

+33
-34
lines changed

LearningHub.Nhs.WebUI/Controllers/CatalogueController.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,7 @@ public async Task<IActionResult> RequestPreviewAccess(CatalogueRequestAccessView
587587
[Route("/allcatalogue/{filterChar}")]
588588
public async Task<IActionResult> GetAllCatalogue(string filterChar = "a")
589589
{
590-
var pageSize = this.settings.AllCataloguePageSize;
591-
var catalogues = await this.catalogueService.GetAllCatalogueAsync(filterChar, pageSize);
590+
var catalogues = await this.catalogueService.GetAllCatalogueAsync(filterChar);
592591
return this.View("allcatalogue", catalogues);
593592
}
594593

LearningHub.Nhs.WebUI/Interfaces/ICatalogueService.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ public interface ICatalogueService
143143
/// The GetAllCatalogueAsync.
144144
/// </summary>
145145
/// <param name="filterChar">The letter.</param>
146-
/// <param name="pageSize">The pageSize.</param>
147146
/// <returns>The allcatalogue result based on letters.</returns>
148-
Task<AllCatalogueResponseViewModel> GetAllCatalogueAsync(string filterChar, int pageSize);
147+
Task<AllCatalogueResponseViewModel> GetAllCatalogueAsync(string filterChar);
149148
}
150149
}

LearningHub.Nhs.WebUI/Services/CatalogueService.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -607,14 +607,13 @@ public async Task<LearningHubValidationResult> RemoveUserFromRestrictedAccessUse
607607
/// GetAllCatalogueAsync.
608608
/// </summary>
609609
/// <param name="filterChar">The filterChar.</param>
610-
/// <param name="pageSize">the pageSize.</param>
611-
/// <returns>A <see cref="Task{TResult}"/> representing the result of the asynchronous operation.</returns>
612-
public async Task<AllCatalogueResponseViewModel> GetAllCatalogueAsync(string filterChar, int pageSize)
610+
/// /// <returns>A <see cref="Task{TResult}"/> representing the result of the asynchronous operation.</returns>
611+
public async Task<AllCatalogueResponseViewModel> GetAllCatalogueAsync(string filterChar)
613612
{
614613
AllCatalogueResponseViewModel viewmodel = new AllCatalogueResponseViewModel { };
615614
var client = await this.LearningHubHttpClient.GetClientAsync();
616615

617-
var request = $"catalogue/allcatalogues/{pageSize}/{filterChar}";
616+
var request = $"catalogue/allcatalogues/{filterChar}";
618617
var response = await client.GetAsync(request).ConfigureAwait(false);
619618

620619
if (response.IsSuccessStatusCode)

WebAPI/LearningHub.Nhs.API/Controllers/CatalogueController.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,14 +375,13 @@ public async Task<IActionResult> AccessRequest(int accessRequestId)
375375
/// <summary>
376376
/// Gets AllCatalogues.
377377
/// </summary>
378-
/// <param name="pageSize">The pageSize.</param>
379378
/// <param name="filterChar">The filterChar.</param>
380379
/// <returns>IActionResult.</returns>
381380
[HttpGet]
382-
[Route("allcatalogues/{pageSize}/{filterChar}")]
383-
public async Task<IActionResult> GetAllCataloguesAsync(int pageSize, string filterChar = null)
381+
[Route("allcatalogues/{filterChar}")]
382+
public async Task<IActionResult> GetAllCataloguesAsync(string filterChar = null)
384383
{
385-
var response = await this.catalogueService.GetAllCataloguesAsync(pageSize, filterChar, this.CurrentUserId);
384+
var response = await this.catalogueService.GetAllCataloguesAsync(filterChar, this.CurrentUserId);
386385
return this.Ok(response);
387386
}
388387
}

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

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
CREATE PROCEDURE [hierarchy].[GetCatalogues] (
1+
-------------------------------------------------------------------------------
2+
-- Author Arunima George
3+
-- Created 15-08-2024
4+
-- Purpose Get Cataloges for View all cataoge page
5+
--
6+
-- Modification History
7+
8+
-- Anju 03-02-2025 TD-4794: Removed page size to disaplay all records
9+
-------------------------------------------------------------------------------
10+
11+
CREATE PROCEDURE [hierarchy].[GetCatalogues] (
212
@userId INT
3-
,@filterChar nvarchar(10)
4-
,@OffsetRows int
5-
,@fetchRows int
6-
)
13+
,@filterChar nvarchar(10))
714
AS
815
BEGIN
916

@@ -30,10 +37,7 @@ BEGIN
3037
WHERE n.Id <> 1 AND n.Hidden = 0 AND n.Deleted = 0 AND cnv.Deleted = 0 AND nv.VersionStatusId = 2
3138
and cnv.Name like @filterChar+'%'
3239
ORDER BY cnv.Name
33-
OFFSET @OffsetRows ROWS
34-
FETCH NEXT @FetchRows ROWS ONLY
35-
3640

37-
41+
3842

3943
END

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
CREATE PROCEDURE [hierarchy].[GetCataloguesCount] (
1+
-------------------------------------------------------------------------------
2+
-- Author Arunima George
3+
-- Created 15-08-2024
4+
-- Purpose Get Cataloges for View all cataoge page
5+
6+
CREATE PROCEDURE [hierarchy].[GetCataloguesCount] (
27
@userId INT
38
)
49
AS

WebAPI/LearningHub.Nhs.Repository.Interface/Hierarchy/ICatalogueNodeVersionRepository.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,9 @@ public interface ICatalogueNodeVersionRepository : IGenericRepository<CatalogueN
132132
/// <summary>
133133
/// Gets catalogues based on filter character.
134134
/// </summary>
135-
/// <param name="pageSize">The pageSize.</param>
136135
/// <param name="filterChar">The filterChar.</param>
137136
/// <param name="userId">The userId.</param>
138137
/// <returns>The catalogues.</returns>
139-
Task<List<AllCatalogueViewModel>> GetAllCataloguesAsync(int pageSize, string filterChar, int userId);
138+
Task<List<AllCatalogueViewModel>> GetAllCataloguesAsync(string filterChar, int userId);
140139
}
141140
}

WebAPI/LearningHub.Nhs.Repository/Hierarchy/CatalogueNodeVersionRepository.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,18 +373,15 @@ public List<AllCatalogueAlphabetModel> GetAllCataloguesAlphaCount(int userId)
373373
/// <summary>
374374
/// Gets catalogues based on filter character.
375375
/// </summary>
376-
/// <param name="pageSize">The pageSize.</param>
377376
/// <param name="filterChar">The filterChar.</param>
378377
/// <param name="userId">The userId.</param>
379378
/// <returns>resources.</returns>
380-
public async Task<List<AllCatalogueViewModel>> GetAllCataloguesAsync(int pageSize, string filterChar, int userId)
379+
public async Task<List<AllCatalogueViewModel>> GetAllCataloguesAsync(string filterChar, int userId)
381380
{
382381
var param0 = new SqlParameter("@userId", SqlDbType.Int) { Value = userId };
383382
var param1 = new SqlParameter("@filterChar", SqlDbType.NVarChar, 10) { Value = filterChar.Trim() };
384-
var param2 = new SqlParameter("@OffsetRows", SqlDbType.Int) { Value = 0 };
385-
var param3 = new SqlParameter("@fetchRows", SqlDbType.Int) { Value = pageSize };
386383

387-
var result = await this.DbContext.AllCatalogueViewModel.FromSqlRaw("[hierarchy].[GetCatalogues] @userId, @filterChar, @OffsetRows, @fetchRows", param0, param1, param2, param3)
384+
var result = await this.DbContext.AllCatalogueViewModel.FromSqlRaw("[hierarchy].[GetCatalogues] @userId, @filterChar", param0, param1)
388385
.AsNoTracking().ToListAsync();
389386
return result;
390387
}

WebAPI/LearningHub.Nhs.Services.Interface/ICatalogueService.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,9 @@ public interface ICatalogueService
250250
/// <summary>
251251
/// GetAllCataloguesAsync.
252252
/// </summary>
253-
/// <param name="pageSize">The pageSize.</param>
254253
/// <param name="filterChar">filterChar.</param>
255254
/// <param name="userId">userId.</param>
256255
/// <returns>The allcatalogue result based on letters.</returns>
257-
Task<AllCatalogueResponseViewModel> GetAllCataloguesAsync(int pageSize, string filterChar, int userId);
256+
Task<AllCatalogueResponseViewModel> GetAllCataloguesAsync(string filterChar, int userId);
258257
}
259258
}

WebAPI/LearningHub.Nhs.Services/CatalogueService.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -968,11 +968,10 @@ public async Task<CatalogueAccessRequestViewModel> AccessRequestAsync(int userId
968968
/// <summary>
969969
/// GetAllCataloguesAsync.
970970
/// </summary>
971-
/// <param name="pageSize">The pageSize.</param>
972971
/// <param name="filterChar">The filterChar.</param>
973972
/// <param name="userId">The userId.</param>
974973
/// <returns>A <see cref="Task{TResult}"/> representing the result of the asynchronous operation.</returns>
975-
public async Task<AllCatalogueResponseViewModel> GetAllCataloguesAsync(int pageSize, string filterChar, int userId)
974+
public async Task<AllCatalogueResponseViewModel> GetAllCataloguesAsync(string filterChar, int userId)
976975
{
977976
var catalogueAlphaCount = this.catalogueNodeVersionRepository.GetAllCataloguesAlphaCount(userId);
978977
var filterCharMod = filterChar.Trim() == "0-9" ? "[0-9]" : filterChar;
@@ -1010,7 +1009,7 @@ public async Task<AllCatalogueResponseViewModel> GetAllCataloguesAsync(int pageS
10101009
}
10111010
}
10121011

1013-
var catalogues = await this.catalogueNodeVersionRepository.GetAllCataloguesAsync(pageSize, filterCharMod, userId);
1012+
var catalogues = await this.catalogueNodeVersionRepository.GetAllCataloguesAsync(filterCharMod, userId);
10141013
foreach (var catalogue in catalogues)
10151014
{
10161015
catalogue.Providers = await this.providerService.GetByCatalogueVersionIdAsync(catalogue.NodeVersionId);

0 commit comments

Comments
 (0)