diff --git a/VPMReposSynchronizer.Core/Services/RepoSync/RepoSyncTaskService.cs b/VPMReposSynchronizer.Core/Services/RepoSync/RepoSyncTaskService.cs index beb68d5..6b6bda7 100644 --- a/VPMReposSynchronizer.Core/Services/RepoSync/RepoSyncTaskService.cs +++ b/VPMReposSynchronizer.Core/Services/RepoSync/RepoSyncTaskService.cs @@ -67,9 +67,10 @@ await defaultDbContext.SyncTasks .SetProperty(task => task.EndTime, endTime => currentDateTime)); } - public async ValueTask GetSyncTasksAsync(int offset = 0, int limit = 20) + public async ValueTask GetSyncTasksAsync(int offset = 0, int limit = 20, string? repoId = null) { return await defaultDbContext.SyncTasks + .Where(task => repoId == null || task.RepoId == repoId) .OrderByDescending(task => task.Id) .Skip(offset) .Take(limit) diff --git a/VPMReposSynchronizer.Entry/Controllers/SyncTaskController.cs b/VPMReposSynchronizer.Entry/Controllers/SyncTaskController.cs index f1a1df6..ca2eb82 100644 --- a/VPMReposSynchronizer.Entry/Controllers/SyncTaskController.cs +++ b/VPMReposSynchronizer.Entry/Controllers/SyncTaskController.cs @@ -18,9 +18,9 @@ public class SyncTaskController( IMapper mapper) : ControllerBase { [HttpGet] - public async Task Index([Range(0, int.MaxValue)] int offset = 0, [Range(1, 100)] int limit = 20) + public async Task Index([Range(0, int.MaxValue)] int offset = 0, [Range(1, 100)] int limit = 20, string? repoId = null) { - var syncTasks = await repoSyncTaskService.GetSyncTasksAsync(offset, limit); + var syncTasks = await repoSyncTaskService.GetSyncTasksAsync(offset, limit, repoId); return mapper.Map(syncTasks); }