Аватар

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
@@ -39,7 +39,7 @@ export class UserApi {
});
}
static async cropAvatar(file: File, cropData: { x: number; y: number; width: number; height: number }) {
static async cropAvatar(file: File, cropData: { x: number; y: number; width: number; height: number; sw: number; sh: number }) {
// Конечная точка в новом бэкенде: POST /api/profiles/avatar/crop
const formData = new FormData();
formData.append('avatar', file);
@@ -47,6 +47,8 @@ export class UserApi {
formData.append('y', cropData.y.toString());
formData.append('width', cropData.width.toString());
formData.append('height', cropData.height.toString());
formData.append('sw', cropData.sw.toString());
formData.append('sh', cropData.sh.toString());
return httpClient.request<User>('/profiles/avatar/crop', {
method: 'POST',