refactor(backend): use insert instead of save
This commit is contained in:
parent
91c56ceb6e
commit
37a4e5f4fc
6 changed files with 10 additions and 10 deletions
|
@ -46,7 +46,7 @@ export default define(meta, async (ps, user) => {
|
|||
const permission = unique(ps.permission.map(v => v.replace(/^(.+)(\/|-)(read|write)$/, '$3:$1')));
|
||||
|
||||
// Create account
|
||||
const app = await Apps.save({
|
||||
const app = await Apps.insert({
|
||||
id: genId(),
|
||||
createdAt: new Date(),
|
||||
userId: user ? user.id : null,
|
||||
|
@ -55,7 +55,7 @@ export default define(meta, async (ps, user) => {
|
|||
permission,
|
||||
callbackUrl: ps.callbackUrl,
|
||||
secret: secret,
|
||||
});
|
||||
}).then(x => Apps.findOneOrFail(x.identifiers[0]));
|
||||
|
||||
return await Apps.pack(app, null, {
|
||||
detail: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue