Files
habitica/website/server/libs/chatReporting/chatReporterFactory.js
2019-10-10 20:11:50 +02:00

13 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.');
}