mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Added initial get group tests
This commit is contained in:
@@ -59,6 +59,31 @@ export class ApiGroup extends ApiObject {
|
||||
|
||||
this._docType = 'groups';
|
||||
}
|
||||
|
||||
async addChat (chat) {
|
||||
let group = this;
|
||||
|
||||
if (!chat) {
|
||||
chat = {
|
||||
id: 'Test_ID',
|
||||
text: 'Test message',
|
||||
flagCount: 0,
|
||||
timestamp: Date(),
|
||||
likes: {},
|
||||
flags: {},
|
||||
uuid: group.leader,
|
||||
contributor: {},
|
||||
backer: {},
|
||||
user: group.leader,
|
||||
};
|
||||
}
|
||||
|
||||
let update = { chat };
|
||||
|
||||
this.update(update, '$push');
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
export class ApiChallenge extends ApiObject {
|
||||
|
||||
Reference in New Issue
Block a user