use Promise.all instead of separate promises
This commit is contained in:
parent
114d416de0
commit
eea2eb4919
1 changed files with 5 additions and 2 deletions
|
@ -22,8 +22,11 @@ export const paramDef = {
|
|||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
const profile = await UserProfiles.findOneByOrFail({ userId: user.id });
|
||||
const userDetailed = await Users.findOneByOrFail({ id: user.id });
|
||||
const [profile, userDetailed] = await Promise.all([
|
||||
UserProfiles.findOneByOrFail({ userId: user.id }),
|
||||
Users.findOneByOrFail({ id: user.id }),
|
||||
]);
|
||||
|
||||
if (userDetailed.isDeleted) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue