42_ft_transcendence/django/frontend/static/js/api/chat/Ask.js
2024-05-14 09:48:25 +02:00

29 lines
494 B
JavaScript

class Ask {
constructor(client) {
this.client = client;
}
async ask_game(asked) {
response = await this.client._post(`/api/chat/ask/`, {
asked:asked,
});
}
async ask_game_canceled() {
}
async ask_game_accepted(asker) {
response = await this.client._post(`/api/chat/ask/accept`, {
asker:asker,
});
}
async ask_game_refused(asker) {
response = await this.client._delete(`/api/chat/ask/`, {
asker:asker,
});
}
}