Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #301 from kmcwebdev/development
Browse files Browse the repository at this point in the history
Remove unnecessary code for updating propelauth user in user-update c…
  • Loading branch information
csulit authored Sep 29, 2023
2 parents 926222a + 446c53c commit bcb4e68
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/users/services/cron/user-update.cron.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Cron } from '@nestjs/schedule';
import { InjectKysely } from 'nestjs-kysely';
import { DB } from 'src/common/types';
import { UsersApiService } from '../users.api.service';
import { propelauth } from 'src/auth/common/lib/propelauth';

const TEMPORARY_APPROVER = 'leanna.pedragosa@kmc.solutions';

Expand Down Expand Up @@ -36,25 +35,6 @@ export class UserUpdateCronService {
const userInErpHrV1 =
await this.usersApiService.fetchUserByEmailInERPHrV1(u.email);

const propelauthUser = await propelauth.fetchUserMetadataByEmail(
u.email,
);

if (propelauthUser) {
await this.pgsql
.updateTable('users as u')
.set({
propelauth_user_id: propelauthUser.userId,
temporary_propelauth_user_id: false,
})
.where('u.email', '=', u.email)
.execute();

this.logger.log(
'Propelauth user updated' + ' : ' + propelauthUser.userId,
);
}

this.logger.log(userInErpHrV1.statusText + ' : ' + u.email);

if (userInErpHrV1.status === 200) {
Expand Down

0 comments on commit bcb4e68

Please sign in to comment.