mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-08 20:13:08 +02:00
23 lines
378 B
TypeScript
23 lines
378 B
TypeScript
|
import db from '../db/mongodb';
|
||
|
|
||
|
const Emoji = db.get<IEmoji>('emoji');
|
||
|
|
||
|
Emoji.createIndex(['name', 'host'], { unique: true });
|
||
|
|
||
|
export default Emoji;
|
||
|
|
||
|
export type IEmoji = {
|
||
|
name: string;
|
||
|
host: string;
|
||
|
url: string;
|
||
|
aliases?: string[];
|
||
|
updatedAt?: Date;
|
||
|
};
|
||
|
|
||
|
export const packEmojis = async (
|
||
|
host: string,
|
||
|
// MeiTODO: filter
|
||
|
) => {
|
||
|
return await Emoji.find({ host });
|
||
|
};
|