Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138307

javascript es6+ - is this the right entry and can it be written better?

$
0
0
const [token] = await Promise.all([
     await this.authService.createToken(userEntity), //this function return token
     await this.userService.setLastLoginDate(userEntity), // return Promise<UpdateResult> (queryBuilder.execute())
]);

    return new LoginPayloadDto(token);

it works, but is it the correct record? My second function doesn't return any variable, it just performs the query and I only need a token


Viewing all articles
Browse latest Browse all 138307

Trending Articles