mirror of
https://github.com/sim1222/misskey.git
synced 2025-08-06 00:33:51 +09:00
refactor(server): use insert instead of save
This commit is contained in:
@ -59,14 +59,14 @@ export const meta = {
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps) => {
|
||||
const announcement = await Announcements.save({
|
||||
const announcement = await Announcements.insert({
|
||||
id: genId(),
|
||||
createdAt: new Date(),
|
||||
updatedAt: null,
|
||||
title: ps.title,
|
||||
text: ps.text,
|
||||
imageUrl: ps.imageUrl,
|
||||
});
|
||||
}).then(x => Announcements.findOneOrFail(x.identifiers[0]));
|
||||
|
||||
return announcement;
|
||||
});
|
||||
|
Reference in New Issue
Block a user