refactor(server): use insert instead of save
This commit is contained in:
parent
4a64280a7c
commit
6be1db00d1
9 changed files with 19 additions and 18 deletions
|
@ -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;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue