Аватар

This commit is contained in:
Халимов Рустам
2026-04-05 01:27:58 +03:00
parent 53f193970c
commit e11240f78f
13 changed files with 133 additions and 47 deletions
@@ -53,9 +53,11 @@ public static class ProfilesEndpoints
int.TryParse(form["y"], out int y);
int.TryParse(form["width"], out int width);
int.TryParse(form["height"], out int height);
int.TryParse(form["sw"], out int sw);
int.TryParse(form["sh"], out int sh);
using var stream = file.OpenReadStream();
var result = await sender.Send(new CropAvatarCommand(userContext.UserId, stream, file.FileName ?? "avatar.jpg", file.ContentType, x, y, width, height), ct);
var result = await sender.Send(new CropAvatarCommand(userContext.UserId, stream, file.FileName ?? "avatar.jpg", file.ContentType, x, y, width, height, sw, sh), ct);
return result.IsSuccess ? Results.Ok(result.Value) : Results.NotFound(result.Error);
}).DisableAntiforgery();