Восстановление подключения, бэк
This commit is contained in:
@@ -19,9 +19,17 @@ public static class MessagesEndpoints
|
||||
{
|
||||
var group = app.MapGroup("api/messages").RequireAuthorization();
|
||||
|
||||
group.MapGet("chat/{chatId:guid}", async ([FromRoute] Guid chatId, [FromQuery] string? cursor, ISender sender, IUserContext userContext, CancellationToken ct) =>
|
||||
group.MapGet("chat/{chatId:guid}", async (
|
||||
[FromRoute] Guid chatId,
|
||||
[FromQuery] string? cursor,
|
||||
[FromQuery] long? afterSequenceId,
|
||||
[FromQuery] long? pivot,
|
||||
[FromQuery] int? limit,
|
||||
ISender sender,
|
||||
IUserContext userContext,
|
||||
CancellationToken ct) =>
|
||||
{
|
||||
var result = await sender.Send(new GetMessagesQuery(userContext.UserId, chatId, cursor), ct);
|
||||
var result = await sender.Send(new GetMessagesQuery(userContext.UserId, chatId, cursor, pivot, afterSequenceId, limit), ct);
|
||||
return result.IsSuccess ? Results.Ok(result.Value) : Results.BadRequest(result.Error.Description);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user