From 2d5799d8475234431713e0e53d1ffb8d01db2b90 Mon Sep 17 00:00:00 2001 From: ChloeLin Date: Fri, 5 Jan 2024 14:34:10 +0800 Subject: [PATCH] GetLatestRules - fix showing same rules --- SSW.Rules.AzFuncs/Functions/Widget/GetLatestRules.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SSW.Rules.AzFuncs/Functions/Widget/GetLatestRules.cs b/SSW.Rules.AzFuncs/Functions/Widget/GetLatestRules.cs index 72623a4..e289ac8 100644 --- a/SSW.Rules.AzFuncs/Functions/Widget/GetLatestRules.cs +++ b/SSW.Rules.AzFuncs/Functions/Widget/GetLatestRules.cs @@ -29,6 +29,8 @@ public async Task Run( var filteredRules = rules .Where(r => string.IsNullOrEmpty(githubUsername) || r.GitHubUsername == githubUsername || r.CreatedBy == githubUsername || r.UpdatedBy == githubUsername) + .GroupBy(r => r.RuleGuid) + .Select(group => group.First()) .OrderByDescending(r => r.UpdatedAt) .Skip(skip) .Take(take);