refactor(server): use insert instead of save
This commit is contained in:
@ -342,7 +342,7 @@ export async function extractEmojis(tags: IObject | IObject[], host: string): Pr
|
||||
|
||||
logger.info(`register emoji host=${host}, name=${name}`);
|
||||
|
||||
return await Emojis.save({
|
||||
return await Emojis.insert({
|
||||
id: genId(),
|
||||
host,
|
||||
name,
|
||||
@ -350,6 +350,6 @@ export async function extractEmojis(tags: IObject | IObject[], host: string): Pr
|
||||
url: tag.icon!.url,
|
||||
updatedAt: new Date(),
|
||||
aliases: [],
|
||||
} as Partial<Emoji>);
|
||||
} as Partial<Emoji>).then(x => Emojis.findOneOrFail(x.identifiers[0]));
|
||||
}));
|
||||
}
|
||||
|
Reference in New Issue
Block a user