Skip to content

Commit

Permalink
fix: Assignment api returns 500 due to typo errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hui1601 committed Feb 8, 2025
1 parent eda33c4 commit 4057fdc
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .idea/dataSources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public ResponseEntity<?> update(
ResponseEntity.status(HttpStatus.BAD_REQUEST).build();
}

@DeleteMapping("delete/{assignmentId}")
@DeleteMapping("/delete/{assignmentId}")
@Operation(summary = "과제 삭제", description = "과제를 삭제합나다. 액세스 토큰 필요.")
public ResponseEntity<?> delete(
@Parameter(description = "과제 ID")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import java.util.Date;

@Entity(name = "AssignmentEntity")
@Entity(name = "assignmentEntity")
@AllArgsConstructor
@NoArgsConstructor
@ToString
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/example/newsper/entity/SubmitEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import java.util.Date;

@Entity(name = "SubmitEntity")
@Entity(name = "submitEntity")
@AllArgsConstructor
@NoArgsConstructor
@ToString
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/com/example/newsper/service/FileService.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,13 @@ public void delete(String path) {
log.info(result);
log.info("{}: {}", filePath, result);

fileRepository.delete(fileEntity);
if (!file.exists()) {
log.info("파일이 존재하지 않습니다.");
return;
}

// 파일 삭제
file.delete();

fileRepository.delete(fileEntity);
}
}

0 comments on commit 4057fdc

Please sign in to comment.