mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 19:56:23 +00:00
12 lines
422 B
JavaScript
12 lines
422 B
JavaScript
import GroupChatReporter from './groupChatReporter';
|
|
import InboxChatReporter from './inboxChatReporter';
|
|
|
|
export function chatReporterFactory (type, req, res) { // eslint-disable-line import/prefer-default-export, max-len
|
|
if (type === 'Group') {
|
|
return new GroupChatReporter(req, res);
|
|
} if (type === 'Inbox') {
|
|
return new InboxChatReporter(req, res);
|
|
}
|
|
|
|
throw new Error('Invalid chat reporter type.');
|
|
}
|