Skip to content
Snippets Groups Projects
Commit 7ab5e7f4 authored by Pedro Pablo Cardona Arroyave's avatar Pedro Pablo Cardona Arroyave
Browse files

Adding other allergies to product

parent beb1de84
No related branches found
No related tags found
No related merge requests found
......@@ -89,7 +89,7 @@ public class ProductController {
}
boolean vegan = CategoryUtil.isVegan(product.getName(),product.getDescription());
if(!vegan){
Allergy allergy = allergyService.getAllergyByName("ikke vegansk").get();
Allergy allergy = allergyService.getAllergyByName("Ikke vegansk").get();
product.addAllergy(allergy);
allergy.addProduct(product);
allergy = allergyService.getAllergyByName("Ikke vegetariansk").get();
......@@ -98,7 +98,7 @@ public class ProductController {
}
boolean vegetarian = CategoryUtil.isVegetarian(product.getName(),product.getDescription(),vegan);
if(!vegetarian){
Allergy allergy = allergyService.getAllergyByName("ikke vegetariansk").get();
Allergy allergy = allergyService.getAllergyByName("Ikke vegetariansk").get();
product.addAllergy(allergy);
allergy.addProduct(product);
}
......
......@@ -3,6 +3,7 @@ package ntnu.idatt2016.v233.SmartMat.controller.product;
import ntnu.idatt2016.v233.SmartMat.dto.request.ProductRequest;
import ntnu.idatt2016.v233.SmartMat.entity.product.Category;
import ntnu.idatt2016.v233.SmartMat.entity.product.Product;
import ntnu.idatt2016.v233.SmartMat.service.AllergyService;
import ntnu.idatt2016.v233.SmartMat.service.product.CategoryService;
import ntnu.idatt2016.v233.SmartMat.service.product.ProductService;
import org.junit.jupiter.api.Test;
......
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