mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-11-16 16:57:14 +01:00
22 lines
509 B
TypeScript
22 lines
509 B
TypeScript
import * as mongo from 'mongodb';
|
|
|
|
import db from '../../db/mongodb';
|
|
|
|
export default db.get('posts') as any; // fuck type definition
|
|
|
|
export function isValidText(text: string): boolean {
|
|
return text.length <= 1000 && text.trim() != '';
|
|
}
|
|
|
|
export type IPost = {
|
|
_id: mongo.ObjectID;
|
|
channel_id: mongo.ObjectID;
|
|
created_at: Date;
|
|
media_ids: mongo.ObjectID[];
|
|
reply_to_id: mongo.ObjectID;
|
|
repost_id: mongo.ObjectID;
|
|
poll: {}; // todo
|
|
text: string;
|
|
user_id: mongo.ObjectID;
|
|
app_id: mongo.ObjectID;
|
|
};
|