Skip to content

Commit

Permalink
πŸ› 자기 μžμ‹ μ„ 블락할 수 없도둝 μ˜ˆμ™Έμ²˜λ¦¬
Browse files Browse the repository at this point in the history
  • Loading branch information
yunochi committed Dec 26, 2024
1 parent e4c7821 commit f10afb2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/api/_service/blocking/blocking-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ export class BlockingService {
return sendApiError(400, 'Bad Request. User not found');
}
try {
if (data.targetHandle === tokenBody?.handle) {
return sendApiError(400, '자기 μžμ‹ μ„ 블락할 수 μ—†μ–΄μš”!');
}
const b = await this.createBlock(targetUser.handle, user.handle, false);
this.logger.debug(`New Block created, hidden: ${b.hidden}, target: ${b.blockeeTarget}`);
} catch (err) {
Expand Down Expand Up @@ -87,6 +90,9 @@ export class BlockingService {
if (q.questioneeHandle !== tokenBody?.handle) {
return sendApiError(403, 'Not your question!');
}
if (q.questioneeHandle === tokenBody.handle) {
return sendApiError(400, '자기 μžμ‹ μ„ 블락할 수 μ—†μ–΄μš”!');
}
if (q.questioner) {
const b = await this.createBlock(q.questioner, tokenBody.handle, false, q.isAnonymous);
this.logger.debug(`New Block created by Question ${q.id}, hidden: ${b.hidden}, target: ${b.blockeeTarget}`);
Expand Down

0 comments on commit f10afb2

Please sign in to comment.