Skip to content
Snippets Groups Projects
Commit 483946a9 authored by Laczkó Csongor Loránd's avatar Laczkó Csongor Loránd
Browse files

refactor(backend): Translate error messages to Hungarian

parent fc577184
Branches
Tags
No related merge requests found
...@@ -59,9 +59,9 @@ public class Controller { ...@@ -59,9 +59,9 @@ public class Controller {
try { try {
dogService.addNewDog(dto); dogService.addNewDog(dto);
} catch (IOException e) { } catch (IOException e) {
return ResponseEntity.status(HttpStatus.NO_CONTENT).body("Wrong picture format, vagy nem tudom én ide csak feljárok"); return ResponseEntity.status(HttpStatus.NO_CONTENT).body("Hibás képformátum");
} }
return ResponseEntity.status(HttpStatus.CREATED).body("Dog created successfully"); return ResponseEntity.status(HttpStatus.CREATED).body("Kutya sikeresen hozzáadva");
} }
@PostMapping(value = "/dogs/{id}/edit", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @PostMapping(value = "/dogs/{id}/edit", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
...@@ -76,16 +76,16 @@ public class Controller { ...@@ -76,16 +76,16 @@ public class Controller {
try { try {
dogDTO = objectMapper.readValue(stringDogDTO, DetailedDogDTO.class); dogDTO = objectMapper.readValue(stringDogDTO, DetailedDogDTO.class);
} catch (IOException e) { } catch (IOException e) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Invalid DogDTO JSON format"); return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Hibás JSON formátum");
} }
// Save the updated dog entity // Save the updated dog entity
try { try {
dogService.editDog(id, dogDTO, mpf); dogService.editDog(id, dogDTO, mpf);
} catch (IOException e) { } catch (IOException e) {
return ResponseEntity.status(HttpStatus.NO_CONTENT).body("Wrong picture format, vagy nem tudom én ide csak feljárok"); return ResponseEntity.status(HttpStatus.NO_CONTENT).body("Hibás képformátum");
} }
return ResponseEntity.ok("Dog attributes updated successfully"); return ResponseEntity.ok("Kutya sikeresen módosítva");
} else { } else {
return ResponseEntity.notFound().build(); return ResponseEntity.notFound().build();
} }
...@@ -109,13 +109,13 @@ public class Controller { ...@@ -109,13 +109,13 @@ public class Controller {
// Check if the username is already taken // Check if the username is already taken
if (userService.isUserExists(request.getUsername())) { if (userService.isUserExists(request.getUsername())) {
return ResponseEntity.badRequest().body("Username already exists"); return ResponseEntity.badRequest().body("Felhasználónév foglalt");
} }
// Save the user entity // Save the user entity
userService.registerUser(request); userService.registerUser(request);
return ResponseEntity.status(HttpStatus.CREATED).body("User registered successfully"); return ResponseEntity.status(HttpStatus.CREATED).body("Felhasználó sikeresen létrehozva");
} }
@PostMapping("/login") @PostMapping("/login")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment