refactor(server): use insert instead of save

This commit is contained in:
syuilo
2022-01-03 02:20:30 +09:00
parent 4a64280a7c
commit 6be1db00d1
9 changed files with 19 additions and 18 deletions

View File

@ -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]));
}));
}