Advance don't merge
This commit is contained in:
9
frontend/static/js/api/chat/channel.js
Normal file
9
frontend/static/js/api/chat/channel.js
Normal file
@ -0,0 +1,9 @@
|
||||
class Channel {
|
||||
constructor(id, members, messages) {
|
||||
this.id = id;
|
||||
this.members = members;
|
||||
this.messages = messages;
|
||||
}
|
||||
}
|
||||
|
||||
export {Channel}
|
19
frontend/static/js/api/chat/channels.js
Normal file
19
frontend/static/js/api/chat/channels.js
Normal file
@ -0,0 +1,19 @@
|
||||
class Channels {
|
||||
constructor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
async createChannel(users_id) {
|
||||
console.log(users_id);
|
||||
let response = await this.client._post("/api/chat/", {
|
||||
users_id:users_id
|
||||
});
|
||||
|
||||
let data = await response.json();
|
||||
if (data == "Channel already exist")
|
||||
return null;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
export {Channels}
|
Reference in New Issue
Block a user