|
|
@ -37,8 +37,10 @@ export class ChatRoom extends Model<ChatRoom> {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns the messages that have been sent in the chatroom
|
|
|
|
* Returns the messages that have been sent in the chatroom
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public async messages(): Promise<ChatMessage[]> {
|
|
|
|
public async messages({first, offset}: {first: number, offset: number}): Promise<ChatMessage[]> {
|
|
|
|
return await this.$get("rMessages") as ChatMessage[];
|
|
|
|
const limit = first ?? 10;
|
|
|
|
|
|
|
|
offset = offset ?? 0;
|
|
|
|
|
|
|
|
return await this.$get("rMessages", {limit, offset}) as ChatMessage[];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|