Skip to content

Commit ed92f87

Browse files
committed
chore(sound): Change soundId to a path variable in the delete request
1 parent 8269985 commit ed92f87

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

src/main/java/net/onelitefeather/vulpes/backend/controller/SoundController.java

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import io.micronaut.http.annotation.Post;
1313
import io.micronaut.http.annotation.Produces;
1414
import io.swagger.v3.oas.annotations.Operation;
15+
import io.swagger.v3.oas.annotations.Parameter;
16+
import io.swagger.v3.oas.annotations.enums.ParameterIn;
1517
import io.swagger.v3.oas.annotations.media.ArraySchema;
1618
import io.swagger.v3.oas.annotations.media.Content;
1719
import io.swagger.v3.oas.annotations.media.Schema;
@@ -268,30 +270,30 @@ public HttpResponse<Page<SoundResponseDTO>> get(@PathVariable UUID id, Pageable
268270
* Creates a new SoundFileSource and links it to a SoundEventEntity by ID.
269271
*
270272
* @param soundEventId the ID of the SoundEventEntity
271-
* @param sourceDTO the DTO containing source data
273+
* @param sourceDTO the DTO containing source data
272274
* @return the created SoundFileSourceDTO
273275
*/
274276
@Operation(
275-
summary = "Create and link a SoundFileSource",
276-
operationId = "createAndLinkSoundFileSource",
277-
description = "Creates a new SoundFileSource and links it to a SoundEventEntity by its ID.",
278-
tags = {"Sound"}
277+
summary = "Create and link a SoundFileSource",
278+
operationId = "createAndLinkSoundFileSource",
279+
description = "Creates a new SoundFileSource and links it to a SoundEventEntity by its ID.",
280+
tags = {"Sound"}
279281
)
280282
@ApiResponse(
281-
responseCode = "200",
282-
description = "The SoundFileSource was successfully created and linked.",
283-
content = @Content(
284-
mediaType = MediaType.APPLICATION_JSON,
285-
schema = @Schema(implementation = SoundResponseDTO.SoundFileSourceDTO.class)
286-
)
283+
responseCode = "200",
284+
description = "The SoundFileSource was successfully created and linked.",
285+
content = @Content(
286+
mediaType = MediaType.APPLICATION_JSON,
287+
schema = @Schema(implementation = SoundResponseDTO.SoundFileSourceDTO.class)
288+
)
287289
)
288290
@ApiResponse(
289-
responseCode = "404",
290-
description = "The SoundEventEntity was not found.",
291-
content = @Content(
292-
mediaType = MediaType.APPLICATION_JSON,
293-
schema = @Schema(implementation = SoundResponseDTO.SoundFileSourceDTO.class)
294-
)
291+
responseCode = "404",
292+
description = "The SoundEventEntity was not found.",
293+
content = @Content(
294+
mediaType = MediaType.APPLICATION_JSON,
295+
schema = @Schema(implementation = SoundResponseDTO.SoundFileSourceDTO.class)
296+
)
295297
)
296298
@Post("{id}/sources")
297299
@Produces(MediaType.APPLICATION_JSON)
@@ -307,7 +309,7 @@ public HttpResponse<SoundResponseDTO> createSource(
307309
* Updates an existing SoundFileSource linked to a SoundEventEntity by ID.
308310
*
309311
* @param soundEventId the ID of the SoundEventEntity
310-
* @param sourceDTO the DTO containing updated source data
312+
* @param sourceDTO the DTO containing updated source data
311313
* @return the updated SoundFileSourceDTO
312314
*/
313315
@Operation(
@@ -347,7 +349,7 @@ public HttpResponse<SoundResponseDTO> updateSource(
347349
* Deletes an existing SoundFileSource linked to a SoundEventEntity by ID.
348350
*
349351
* @param soundEventId the ID of the SoundEventEntity
350-
* @param sourceDTO the DTO containing source data to delete
352+
* @param soundId the DTO containing source data to delete
351353
* @return the deleted SoundFileSourceDTO
352354
*/
353355
@Operation(
@@ -372,19 +374,17 @@ public HttpResponse<SoundResponseDTO> updateSource(
372374
schema = @Schema(implementation = SoundResponseDTO.SoundFileSourceDTO.class)
373375
)
374376
)
375-
@Delete("{id}/sources/delete")
377+
@Delete("{id}/sources/delete/{soundId}")
376378
@Produces(MediaType.APPLICATION_JSON)
377379
public HttpResponse<SoundResponseDTO> deleteSource(
380+
@Parameter(name = "id", description = "The id of the sound event", in = ParameterIn.PATH, required = true)
378381
@PathVariable("id") UUID soundEventId,
379-
@Body UUID sourceDTO
382+
@Parameter(name = "soundID", description = "The id of the sound file", in = ParameterIn.PATH, required = true)
383+
@PathVariable("soundId") UUID soundId
380384
) {
381-
SoundResponseDTO result = soundService.deleteLinkedSource(soundEventId, sourceDTO);
385+
SoundResponseDTO result = soundService.deleteLinkedSource(soundEventId, soundId);
382386
return HttpResponse.ok(result);
383387
}
384388

385389

386-
387-
388-
389-
390390
}

0 commit comments

Comments
 (0)