馃殌 [Feature] Backend: create a CRUD for rooms
Created by: Elweyn
馃殌 Feature
For the query of the list of rooms it would be great to have the room with the last message at first.
example code source: https://github.com/antoine92190/vue-advanced-chat
{
roomId: '1',
roomName: 'Room 1',
avatar: 'assets/imgs/people.png',
unreadCount: 4,
index: 3,
lastMessage: {
_id: 'xyz',
content: 'Last message received',
senderId: '1234',
username: 'John Doe',
timestamp: '10:20',
saved: true,
distributed: false,
seen: false,
new: true
},
users: [
{
_id: '1234',
username: 'John Doe',
avatar: 'assets/imgs/doe.png',
status: {
state: 'online',
lastChanged: 'today, 14:30'
}
},
{
_id: '4321',
username: 'John Snow',
avatar: 'assets/imgs/snow.png',
status: {
state: 'offline',
lastChanged: '14 July, 20:00'
}
}
],
typingUsers: [ 4321 ]
}
]"
馃 TODOs
-
Mutation create a new room -
Query list of rooms - the room with the last message at first
-
Optional: Update room name -
Optional: Delete room