Correction d'un bug qui tentait d'écrire les fichiers dans le mauvais dossier.

This commit is contained in:
FyloZ 2021-04-06 10:26:53 -04:00
parent e9ed33432d
commit f3d1230e75
2 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ class MaterialController(private val materialService: MaterialService) {
@PostMapping(consumes = [MediaType.MULTIPART_FORM_DATA_VALUE])
@PreAuthorize("hasAuthority('EDIT_MATERIALS')")
fun save(@Valid @RequestBody material: MaterialSaveDto, simdutFile: MultipartFile?) =
fun save(@Valid material: MaterialSaveDto, simdutFile: MultipartFile?) =
created<Material>(MATERIAL_CONTROLLER_PATH) {
materialService.save(
materialSaveDto(
@ -44,7 +44,7 @@ class MaterialController(private val materialService: MaterialService) {
@PutMapping(consumes = [MediaType.MULTIPART_FORM_DATA_VALUE])
@PreAuthorize("hasAuthority('EDIT_MATERIALS')")
fun update(@Valid @RequestBody material: MaterialUpdateDto, simdutFile: MultipartFile?) =
fun update(@Valid material: MaterialUpdateDto, simdutFile: MultipartFile?) =
noContent {
materialService.update(
materialUpdateDto(

View File

@ -41,7 +41,7 @@ class FileService(
fun write(multipartFile: MultipartFile, path: String): Boolean =
if (multipartFile.size <= 0) true
else try {
multipartFile.transferTo(create(path))
multipartFile.transferTo(create(path).toPath())
true
} catch (ex: IOException) {
logger.error("Unable to write multipart file", ex)