mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-18 10:41:56 +10:00
update dependencies, attempt to fix server restart issue
This commit is contained in:
@ -6,7 +6,6 @@ import { compareSync, hashSync } from 'bcryptjs';
|
||||
import { OAuth2Client } from 'google-auth-library';
|
||||
|
||||
import { PostgresErrorCode } from '@/database/errorCodes.enum';
|
||||
import { ResumeService } from '@/resume/resume.service';
|
||||
import { CreateGoogleUserDto } from '@/users/dto/create-google-user.dto';
|
||||
import { User } from '@/users/entities/user.entity';
|
||||
import { UsersService } from '@/users/users.service';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { IsNotEmpty, IsString, MinLength } from 'class-validator';
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
|
||||
export class UpdateProfileDto {
|
||||
@IsString()
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { HttpModule } from '@nestjs/axios';
|
||||
import { CacheModule, Module } from '@nestjs/common';
|
||||
import { CacheModule } from '@nestjs/cache-manager';
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
|
||||
import { FontsController } from './fonts.controller';
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { HealthCheck, HealthCheckService, HttpHealthIndicator, TypeOrmHealthIndicator } from '@nestjs/terminus';
|
||||
import { HealthCheck, HealthCheckService, TypeOrmHealthIndicator } from '@nestjs/terminus';
|
||||
|
||||
@Controller('health')
|
||||
export class HealthController {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Controller, Get, InternalServerErrorException, Param, Query } from '@nestjs/common';
|
||||
import { Controller, Get, Param, Query } from '@nestjs/common';
|
||||
|
||||
import { PrinterService } from './printer.service';
|
||||
|
||||
|
||||
@ -252,10 +252,10 @@ export class ResumeService {
|
||||
const publicUrl = urlPrefix + key;
|
||||
await this.s3Client.send(
|
||||
new PutObjectCommand({
|
||||
Bucket: this.configService.get<string>('storage.bucket'),
|
||||
Key: key,
|
||||
Body: file.buffer,
|
||||
ACL: 'public-read',
|
||||
Bucket: this.configService.get<string>('storage.bucket'),
|
||||
})
|
||||
);
|
||||
updatedResume = set(resume, 'basics.photo.url', publicUrl);
|
||||
@ -283,14 +283,15 @@ export class ResumeService {
|
||||
const resume = await this.findOne(id, userId);
|
||||
const publicUrl = resume.basics.photo.url;
|
||||
|
||||
if (!publicUrl || publicUrl === '') return;
|
||||
|
||||
if (this.s3Enabled) {
|
||||
const urlPrefix = this.configService.get<string>('storage.urlPrefix');
|
||||
const key = publicUrl.replace(urlPrefix, '');
|
||||
|
||||
await this.s3Client.send(
|
||||
new DeleteObjectCommand({
|
||||
Bucket: this.configService.get<string>('storage.bucket'),
|
||||
Key: key,
|
||||
Bucket: this.configService.get<string>('storage.bucket'),
|
||||
})
|
||||
);
|
||||
} else {
|
||||
@ -299,9 +300,7 @@ export class ResumeService {
|
||||
|
||||
const isValidFile = (await fs.stat(filePath)).isFile();
|
||||
|
||||
if (isValidFile) {
|
||||
await fs.unlink(filePath);
|
||||
}
|
||||
if (isValidFile) await fs.unlink(filePath);
|
||||
}
|
||||
|
||||
const updatedResume = set(resume, 'basics.photo.url', '');
|
||||
|
||||
Reference in New Issue
Block a user