mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-16 17:51:43 +10:00
updates to app
This commit is contained in:
@ -108,11 +108,11 @@ export class ResumeService {
|
||||
}
|
||||
|
||||
findAllByUser(userId: number) {
|
||||
return this.resumeRepository.find({ user: { id: userId } });
|
||||
return this.resumeRepository.find({ where: { user: { id: userId } } });
|
||||
}
|
||||
|
||||
async findOne(id: number, userId?: number) {
|
||||
const resume = await this.resumeRepository.findOne(id);
|
||||
const resume = await this.resumeRepository.findOne({ where: { id } });
|
||||
|
||||
if (!resume) {
|
||||
throw new HttpException('The resume you are looking does not exist, or maybe never did?', HttpStatus.NOT_FOUND);
|
||||
@ -129,7 +129,7 @@ export class ResumeService {
|
||||
}
|
||||
|
||||
async findOneByShortId(shortId: string, userId?: number, secretKey?: string) {
|
||||
const resume = await this.resumeRepository.findOne({ shortId });
|
||||
const resume = await this.resumeRepository.findOne({ where: { shortId } });
|
||||
|
||||
if (!resume) {
|
||||
throw new HttpException('The resume you are looking does not exist, or maybe never did?', HttpStatus.NOT_FOUND);
|
||||
@ -147,7 +147,7 @@ export class ResumeService {
|
||||
}
|
||||
|
||||
async findOneByIdentifier(username: string, slug: string, userId?: number, secretKey?: string) {
|
||||
const resume = await this.resumeRepository.findOne({ user: { username }, slug });
|
||||
const resume = await this.resumeRepository.findOne({ where: { user: { username }, slug } });
|
||||
|
||||
if (!resume) {
|
||||
throw new HttpException('The resume you are looking does not exist, or maybe never did?', HttpStatus.NOT_FOUND);
|
||||
|
||||
@ -23,7 +23,7 @@ export class UsersService {
|
||||
) {}
|
||||
|
||||
async findById(id: number): Promise<User> {
|
||||
const user = await this.userRepository.findOne({ id });
|
||||
const user = await this.userRepository.findOne({ where: { id } });
|
||||
|
||||
if (user) {
|
||||
return user;
|
||||
@ -33,7 +33,7 @@ export class UsersService {
|
||||
}
|
||||
|
||||
async findByEmail(email: string): Promise<User> {
|
||||
const user = await this.userRepository.findOne({ email });
|
||||
const user = await this.userRepository.findOne({ where: { email } });
|
||||
|
||||
if (user) {
|
||||
return user;
|
||||
@ -55,7 +55,7 @@ export class UsersService {
|
||||
}
|
||||
|
||||
async findByResetToken(resetToken: string): Promise<User> {
|
||||
const user = await this.userRepository.findOne({ resetToken });
|
||||
const user = await this.userRepository.findOne({ where: { resetToken } });
|
||||
|
||||
if (user) {
|
||||
return user;
|
||||
|
||||
Reference in New Issue
Block a user