refactor(backend): use insert instead of save

This commit is contained in:
syuilo
2022-01-26 00:51:26 +09:00
parent 91c56ceb6e
commit 37a4e5f4fc
6 changed files with 10 additions and 10 deletions

View File

@@ -56,14 +56,14 @@ export default define(meta, async (ps, user) => {
}
}
const channel = await Channels.save({
const channel = await Channels.insert({
id: genId(),
createdAt: new Date(),
userId: user.id,
name: ps.name,
description: ps.description || null,
bannerId: banner ? banner.id : null,
} as Channel);
} as Channel).then(x => Channels.findOneOrFail(x.identifiers[0]));
return await Channels.pack(channel, user);
});