refactor(server): use insert instead of save
This commit is contained in:
@@ -38,7 +38,7 @@ export default define(meta, async (ps, me) => {
|
||||
|
||||
const name = file.name.split('.')[0].match(/^[a-z0-9_]+$/) ? file.name.split('.')[0] : `_${rndstr('a-z0-9', 8)}_`;
|
||||
|
||||
const emoji = await Emojis.save({
|
||||
const emoji = await Emojis.insert({
|
||||
id: genId(),
|
||||
updatedAt: new Date(),
|
||||
name: name,
|
||||
@@ -47,7 +47,7 @@ export default define(meta, async (ps, me) => {
|
||||
aliases: [],
|
||||
url: file.url,
|
||||
type: file.type,
|
||||
});
|
||||
}).then(x => Emojis.findOneOrFail(x.identifiers[0]));
|
||||
|
||||
await getConnection().queryResultCache!.remove(['meta_emojis']);
|
||||
|
||||
|
Reference in New Issue
Block a user