File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Assets/Plugins/StreamChat/Core Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ public interface IStreamPollsApi
3030 /// <param name="queryRequest">Request with query filters and parameters</param>
3131 /// <returns>List of polls matching the query</returns>
3232 Task < IEnumerable < IStreamPoll > > QueryPollsAsync ( StreamQueryPollsRequest queryRequest ) ;
33+
34+ /// <summary>
35+ /// Delete a poll by ID
36+ /// </summary>
37+ /// <param name="pollId">The poll ID to delete</param>
38+ Task DeletePollAsync ( string pollId ) ;
3339 }
3440}
3541
Original file line number Diff line number Diff line change @@ -56,6 +56,19 @@ public async Task<IEnumerable<IStreamPoll>> QueryPollsAsync(StreamQueryPollsRequ
5656 return result ;
5757 }
5858
59+ public async Task DeletePollAsync ( string pollId )
60+ {
61+ StreamAsserts . AssertNotNullOrEmpty ( pollId , nameof ( pollId ) ) ;
62+
63+ await _lowLevelClient . InternalPollsApi . DeletePollAsync ( pollId ) ;
64+
65+ // Remove from cache if present
66+ if ( _cache . Polls . TryGet ( pollId , out var poll ) )
67+ {
68+ _cache . Polls . Remove ( poll ) ;
69+ }
70+ }
71+
5972 internal StreamPollsApi ( StreamChatLowLevelClient lowLevelClient , ICache cache )
6073 {
6174 _lowLevelClient = lowLevelClient ?? throw new ArgumentNullException ( nameof ( lowLevelClient ) ) ;
You can’t perform that action at this time.
0 commit comments