Changeset c3278ac for Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/PostController.java
- Timestamp:
- 03/09/23 16:11:48 (16 months ago)
- Branches:
- main
- Children:
- 0078d84, 4ab3aae
- Parents:
- 8b7dd7f (diff), 264d675 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- SazdovaEkaterina <74919977+SazdovaEkaterina@…> (03/09/23 16:11:48)
- git-committer:
- GitHub <noreply@…> (03/09/23 16:11:48)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/PostController.java
r8b7dd7f rc3278ac 58 58 if(newPetCheckbox == true){ 59 59 60 Pet newPet = new Pet(imageUrl, AgeGroup.valueOf(ageGroup), Size.valueOf(size), breed, name, Species.valueOf(species), Gender.valueOf(gender), canBeFostered, null, employee.getShelter Id());60 Pet newPet = new Pet(imageUrl, AgeGroup.valueOf(ageGroup), Size.valueOf(size), breed, name, Species.valueOf(species), Gender.valueOf(gender), canBeFostered, null, employee.getShelter()); 61 61 this.petService.save(newPet); 62 62 63 Post post = new Post(LocalDate.now(), imageUrl, newPet .getId(), null, employee.getId());63 Post post = new Post(LocalDate.now(), imageUrl, newPet, null, employee); 64 64 this.postService.save(post); 65 65 … … 68 68 Pet selectedPet = this.petService.findById(petId); 69 69 70 Post post = new Post(LocalDate.now(), imageUrl, selectedPet .getId(), null, employee.getId());70 Post post = new Post(LocalDate.now(), imageUrl, selectedPet, null, employee); 71 71 this.postService.save(post); 72 72 … … 92 92 93 93 Post post = this.postService.findById(id).get(); 94 Pet pet = this.petService.findById(post.getPetId());94 Pet pet = post.getPet(); 95 95 96 96 model.addAttribute("pet", pet);
Note:
See TracChangeset
for help on using the changeset viewer.