Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async function bootstrap() {
'http://localhost:8080',
'https://p-a-d.store',
],
methods: ['GET', 'POST', 'PATCH', 'DELETE', 'OPTIONS'], // 💡 GET 포함
methods: ['GET', 'POST', 'PATCH', 'DELETE', 'OPTIONS', 'PUT'], // 💡 GET 포함
credentials: true,
allowedHeaders: ['Authorization', 'Content-Type'], // 💡 CORS 요청 헤더 허용
exposedHeaders: ['Authorization'], // 💡 클라이언트에서 응답 헤더 사용 가능
Expand Down
2 changes: 1 addition & 1 deletion src/modules/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class AuthService {
code,
client_id: process.env.GOOGLE_CLIENT_ID,
client_secret: process.env.GOOGLE_CLIENT_SECRET,
redirect_uri: process.env.GOOGLE_CALLBACK_DEVELOP_URL,
redirect_uri: process.env.GOOGLE_CALLBACK_DEPLOY_URL,
grant_type: 'authorization_code',
}
);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/auth/strategies/google.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') {
super({
clientID: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
callbackURL: process.env.GOOGLE_CALLBACK_DEVELOP_URL,
callbackURL: process.env.GOOGLE_CALLBACK_DEPLOY_URL,
scope: ['email', 'profile'],
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class SseInterceptor implements NestInterceptor {
res.setHeader('Content-Type', 'text/event-stream');
res.setHeader('Cache-Control', 'no-cache, no-transform');
res.setHeader('Connection', 'keep-alive');
res.setHeader('Access-Control-Allow-Origin', 'http://localhost:5173'); // CORS 설정 필요시 추가
res.setHeader('Access-Control-Allow-Origin', '*'); // CORS 설정 필요시 추가
res.setHeader('Access-Control-Allow-Credentials', 'true');
res.flushHeaders(); // 즉시 헤더를 전송하여 연결이 끊기지 않도록 함
}
Expand Down
9 changes: 9 additions & 0 deletions src/modules/project/project.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,11 @@ export class ProjectService {
where: { id: projectId },
select: { user_id: true },
});

if (!auth) {
throw new NotFoundException('프로젝트를 찾을 수 없습니다.');
}

return auth.user_id === userId;
}

Expand Down Expand Up @@ -825,6 +830,10 @@ export class ProjectService {
where: { post_id: projectId },
}),

this.prisma.userApplyProject.deleteMany({
where: { post_id: projectId },
}),

this.prisma.projectPost.delete({
where: { id: projectId },
}),
Expand Down
1 change: 1 addition & 0 deletions src/search/search.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ export class SearchService {
viewCount: res.view + 1,
status: res.recruiting ? 'OPEN' : 'CLOSED',
isMarked: res.Saves.length,
createdAT: res.created_at,
}));
return projects;
}
Expand Down
Loading