updates to app

This commit is contained in:
Amruth Pillai
2022-06-19 20:44:28 +02:00
parent 164403c495
commit ae3ff274ee
10 changed files with 2167 additions and 3413 deletions

View File

@ -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);

View File

@ -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;