-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #406 from rocket-admin/backend_microservices
reworked google/github login
- Loading branch information
Showing
5 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
backend/src/microservices/saas-microservice/use-cases/get-users-infos-by-email.use.case.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Inject } from '@nestjs/common'; | ||
import AbstractUseCase from '../../../common/abstract-use.case.js'; | ||
import { IGlobalDatabaseContext } from '../../../common/application/global-database-context.interface.js'; | ||
import { BaseType } from '../../../common/data-injection.tokens.js'; | ||
import { UserEntity } from '../../../entities/user/user.entity.js'; | ||
import { ISaasGetUsersInfosByEmail } from './saas-use-cases.interface.js'; | ||
|
||
export class GetUsersInfosByEmailUseCase | ||
extends AbstractUseCase<string, Array<UserEntity>> | ||
implements ISaasGetUsersInfosByEmail | ||
{ | ||
constructor( | ||
@Inject(BaseType.GLOBAL_DB_CONTEXT) | ||
protected _dbContext: IGlobalDatabaseContext, | ||
) { | ||
super(); | ||
} | ||
|
||
protected async implementation(userEmail: string): Promise<Array<UserEntity>> { | ||
const foundUsers: Array<UserEntity> = await this._dbContext.userRepository.findAllUsersWithEmail(userEmail); | ||
return foundUsers.map((user) => { | ||
delete user.password; | ||
return user; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters