42_ft_transcendence/frontend/static/js/api/MyProfile.js
2024-01-22 13:21:51 +01:00

30 lines
466 B
JavaScript

import { Client } from "./client.js";
import { Profile } from "./profile.js";
class MyProfile extends Profile
{
/**
* @param {Client} client
*/
constructor (client)
{
super(client, "me")
}
/**
*
* @param {*} form_data
* @returns
*/
async change_avatar(form_data)
{
let response = await this.client._patch_file(`/api/profiles/me`, form_data);
let response_data = await response.json()
return response_data;
}
}
export {MyProfile}