Skip to content
Snippets Groups Projects

Resolve "(M09) Genera un nou endpoint DELETE /ubicacio/{id}/artefacte/{id} que elimini un artefacte d'una ubicació"

4 files
+ 24
0
Compare changes
  • Side-by-side
  • Inline

Files

@@ -71,4 +71,12 @@ public class UbicacionController {
Artefacto updatedArtefacto = artefactoService.setUbicacionToArtefacto(artefactoId, ubicacionId);
return ResponseEntity.ok(updatedArtefacto);
}
@DeleteMapping("/{ubicacionId}/artefacte/{artefactoId}")
public ResponseEntity<Void> removeUbicacionFromArtefacto(
@PathVariable int ubicacionId,
@PathVariable int artefactoId) {
artefactoService.removeUbicacionFromArtefacto(ubicacionId, artefactoId);
return ResponseEntity.noContent().build();
}
}
Loading