55using Microsoft . AspNetCore . Mvc ;
66using Modix . Data . Models ;
77using Modix . Data . Models . Moderation ;
8+ using Modix . Models ;
89using Modix . Models . Core ;
910using Modix . Services . Moderation ;
1011using Modix . Services . Utilities ;
1112using Modix . Web . Shared . Models . DeletedMessages ;
12- using MudBlazor ;
1313
1414namespace Modix . Web . Controllers ;
1515
@@ -27,7 +27,7 @@ public DeletedMessagesController(ModerationService moderationService, DiscordSoc
2727 }
2828
2929 [ HttpPut ]
30- public async Task < DeletedMessageBatchInformation [ ] > GetDeletedMessagesBatchAsync ( DeletedMessagesQuery deletedMessagesQuery )
30+ public async Task < RecordsPage < DeletedMessageBatchInformation > > GetDeletedMessagesBatchAsync ( DeletedMessagesQuery deletedMessagesQuery )
3131 {
3232 var tableState = deletedMessagesQuery . TableState ;
3333 var tableFilter = deletedMessagesQuery . Filter ;
@@ -60,10 +60,9 @@ public async Task<DeletedMessageBatchInformation[]> GetDeletedMessagesBatchAsync
6060 PageSize = tableState . PageSize ,
6161 } ;
6262
63-
6463 var deletedMessages = await _moderationService . SearchDeletedMessagesAsync ( searchCriteria , [ sortingCriteria ] , pagingCriteria ) ;
6564
66- return deletedMessages . Records
65+ var deletedMessagesBatchInformation = deletedMessages . Records
6766 . Select ( x => new DeletedMessageBatchInformation (
6867 x . Channel . Name ,
6968 x . Author . GetFullUsername ( ) ,
@@ -73,6 +72,13 @@ public async Task<DeletedMessageBatchInformation[]> GetDeletedMessagesBatchAsync
7372 x . Reason ,
7473 x . BatchId ) )
7574 . ToArray ( ) ;
75+
76+ return new RecordsPage < DeletedMessageBatchInformation >
77+ {
78+ FilteredRecordCount = deletedMessagesBatchInformation . Length ,
79+ Records = deletedMessagesBatchInformation ,
80+ TotalRecordCount = deletedMessages . TotalRecordCount
81+ } ;
7682 }
7783
7884 [ HttpGet ( "{batchId}" ) ]
0 commit comments