wip
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
import * as mongo from 'mongodb';
|
||||
import db from '../../db/mongodb';
|
||||
|
||||
export default db.get('messaging_histories') as any; // fuck type definition
|
||||
const MessagingHistory = db.get<IMessagingHistory>('messagingHistories');
|
||||
export default MessagingHistory;
|
||||
|
||||
export type IMessagingHistory = {
|
||||
_id: mongo.ObjectID;
|
||||
updatedAt: Date;
|
||||
userId: mongo.ObjectID;
|
||||
partnerId: mongo.ObjectID;
|
||||
messageId: mongo.ObjectID;
|
||||
};
|
||||
|
@@ -5,16 +5,17 @@ import { pack as packFile } from './drive-file';
|
||||
import db from '../../db/mongodb';
|
||||
import parse from '../common/text';
|
||||
|
||||
const MessagingMessage = db.get<IMessagingMessage>('messaging_messages');
|
||||
const MessagingMessage = db.get<IMessagingMessage>('messagingMessages');
|
||||
export default MessagingMessage;
|
||||
|
||||
export interface IMessagingMessage {
|
||||
_id: mongo.ObjectID;
|
||||
created_at: Date;
|
||||
createdAt: Date;
|
||||
text: string;
|
||||
user_id: mongo.ObjectID;
|
||||
recipient_id: mongo.ObjectID;
|
||||
is_read: boolean;
|
||||
userId: mongo.ObjectID;
|
||||
recipientId: mongo.ObjectID;
|
||||
isRead: boolean;
|
||||
fileId: mongo.ObjectID;
|
||||
}
|
||||
|
||||
export function isValidText(text: string): boolean {
|
||||
|
Reference in New Issue
Block a user