Skip to content
Snippets Groups Projects
Commit 04f29817 authored by Birk Øvstetun Narvhus's avatar Birk Øvstetun Narvhus
Browse files

fixed return data of product endpoint to return allergies and category

parent c38aacfe
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,7 @@ public class Product{
@ManyToOne(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH},
fetch = FetchType.LAZY)
@JoinColumn(name = "category_name")
@JsonIgnore
@JsonIncludeProperties("categoryName")
Category category;
@Column(name = "image_url")
......@@ -73,8 +73,7 @@ public class Product{
@ManyToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH},
fetch = FetchType.LAZY, mappedBy = "products")
@JsonIgnoreProperties({"products", "users"})
@JsonIgnore
@JsonIncludeProperties("name")
List<Allergy> allergies;
@OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment