3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-23 17:45:03 +00:00

Update backend/src/data/ApiLogins.ts

Combine early return statements

Co-authored-by: Almeida <almeidx@pm.me>
This commit is contained in:
Luke 2021-10-08 14:17:45 -05:00 committed by GitHub
parent b74c6ac2a5
commit cd42cfa546
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,10 +94,7 @@ export class ApiLogins extends BaseRepository {
const login = await this.apiLogins.createQueryBuilder().where("id = :id", { id: loginId }).getOne(); const login = await this.apiLogins.createQueryBuilder().where("id = :id", { id: loginId }).getOne();
if (!login) return; if (!login || moment.utc(login.expires_at).isSameOrAfter(updatedTime)) return;
if (moment.utc(login.expires_at).isSameOrAfter(updatedTime)) return;
await this.apiLogins.update( await this.apiLogins.update(
{ id: loginId }, { id: loginId },
{ {