Ignore:
Timestamp:
03/08/23 17:43:21 (16 months ago)
Author:
SazdovaEkaterina <sazdovaekaterina@…>
Branches:
main
Children:
5dea0b7
Parents:
c03e53b
Message:

fix usages that got broken with the changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/PostController.java

    rc03e53b re76c5a6  
    5858        if(newPetCheckbox == true){
    5959
    60             Pet newPet = new Pet(imageUrl, AgeGroup.valueOf(ageGroup), Size.valueOf(size), breed, name, Species.valueOf(species), Gender.valueOf(gender), canBeFostered, null, employee.getShelterId());
     60            Pet newPet = new Pet(imageUrl, AgeGroup.valueOf(ageGroup), Size.valueOf(size), breed, name, Species.valueOf(species), Gender.valueOf(gender), canBeFostered, null, employee.getShelter());
    6161            this.petService.save(newPet);
    6262
    63             Post post = new Post(LocalDate.now(), imageUrl, newPet.getId(), null, employee.getId());
     63            Post post = new Post(LocalDate.now(), imageUrl, newPet, null, employee);
    6464            this.postService.save(post);
    6565
     
    6868            Pet selectedPet = this.petService.findById(petId);
    6969
    70             Post post = new Post(LocalDate.now(), imageUrl, selectedPet.getId(), null, employee.getId());
     70            Post post = new Post(LocalDate.now(), imageUrl, selectedPet, null, employee);
    7171            this.postService.save(post);
    7272
     
    9292
    9393        Post post = this.postService.findById(id).get();
    94         Pet pet = this.petService.findById(post.getPetId());
     94        Pet pet = post.getPet();
    9595
    9696        model.addAttribute("pet", pet);
Note: See TracChangeset for help on using the changeset viewer.