Аватар
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user