From c4e55d74f6cb0044a615017d0b1d9aad44da1f15 Mon Sep 17 00:00:00 2001 From: vitalii-bezuhlyi Date: Thu, 5 Sep 2024 15:16:21 +0300 Subject: [PATCH] Fixed pagination in data source handler --- Apps.XTM/DataSourceHandlers/ProjectDataHandler.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Apps.XTM/DataSourceHandlers/ProjectDataHandler.cs b/Apps.XTM/DataSourceHandlers/ProjectDataHandler.cs index d6d64b1..f6e3e63 100644 --- a/Apps.XTM/DataSourceHandlers/ProjectDataHandler.cs +++ b/Apps.XTM/DataSourceHandlers/ProjectDataHandler.cs @@ -1,6 +1,5 @@ using Apps.XTM.Actions; using Apps.XTM.Invocables; -using Apps.XTM.Models.Request.Projects; using Blackbird.Applications.Sdk.Common.Dynamic; using Blackbird.Applications.Sdk.Common.Invocation; @@ -12,11 +11,9 @@ public class ProjectDataHandler(InvocationContext invocationContext) public async Task> GetDataAsync(DataSourceContext context, CancellationToken cancellationToken) { var actions = new ProjectActions(InvocationContext, null!); - var response = await actions.ListProjects(new ListProjectsRequest()); + var response = await actions.ListProjects(new() { Name = context.SearchString }); return response.Projects - .Where(x => context.SearchString == null || x.Name.Contains(context.SearchString, StringComparison.OrdinalIgnoreCase)) - .Take(20) .ToDictionary(x => x.Id, x => x.Name); } } \ No newline at end of file