fix(server): photo uploads not working, fix save location and returned url

fix #658
This commit is contained in:
Amruth Pillai 2022-03-12 12:37:04 +01:00
parent dda42b4c6b
commit 799f20823e
No known key found for this signature in database
GPG Key ID: E3C57DF9B80855AD
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ import { UsersModule } from './users/users.module';
@Module({
imports: [
ServeStaticModule.forRoot({
serveRoot: '/api',
serveRoot: '/assets',
rootPath: join(__dirname, 'assets'),
}),
ConfigModule,

View File

@ -219,7 +219,7 @@ export class ResumeService {
async uploadPhoto(id: number, userId: number, filename: string) {
const resume = await this.findOne(id, userId);
const url = `/api/uploads/${userId}/${id}/${filename}`;
const url = `/api/assets/uploads/${userId}/${id}/${filename}`;
const updatedResume = set(resume, 'basics.photo.url', url);
return this.resumeRepository.save<Resume>(updatedResume);