Correction d'un bug qui tentait d'écrire les fichiers dans le mauvais dossier.
This commit is contained in:
parent
e9ed33432d
commit
f3d1230e75
|
@ -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(
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue