26 lines
686 B
JavaScript
26 lines
686 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.ChatMapper = void 0;
|
|
class ChatMapper {
|
|
static toShortDto(chat) {
|
|
return {
|
|
id: chat.id,
|
|
userCount: chat.users?.length ?? 0,
|
|
state: chat.state,
|
|
};
|
|
}
|
|
static toDetailDto(chat) {
|
|
return {
|
|
id: chat.id,
|
|
users: chat.users ?? [],
|
|
messages: chat.messages,
|
|
updateDate: chat.updateDate,
|
|
state: chat.state,
|
|
};
|
|
}
|
|
static toShortDtoList(chats) {
|
|
return chats.map(this.toShortDto);
|
|
}
|
|
}
|
|
exports.ChatMapper = ChatMapper;
|
|
//# sourceMappingURL=ChatMapper.js.map
|