u4819210 / social-networks-for-fun

Automatically exported from code.google.com/p/social-networks-for-fun
0 stars 0 forks source link

saveFavourite is choking #29

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
error from the command line testing:

curl -d "username=guest123&businessId=69371" 
http://localhost:8080/prototype-socialrays-jersey/UserResources/saveFavouriteorg
.springframework.dao.DataIntegrityViolationException: Could not execute JDBC 
batch update; SQL [insert into elgg_user_favourite (category, business_id, 
user_name) values (?, ?, ?)]; constraint [null]; nested exception is 
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC 
batch update

Original issue reported on code.google.com by johnliu...@gmail.com on 13 Aug 2010 at 7:59

GoogleCodeExporter commented 8 years ago
Related to favourite:

curl -d "username=guest123" 
http://localhost:8080/prototype-socialrays-jersey/UserResources/getUserFavourite
s
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to 
prototype.socialrays.entities.ElggRestaurantInfo

Original comment by johnliu...@gmail.com on 13 Aug 2010 at 9:08

GoogleCodeExporter commented 8 years ago
More details on saveFavourite API. The first time I called the saveFavourite 
API, it didn't return anything. From the second time, it started to give 
constraint errors ... I guess it's already saved to DB.

So 2 things:

1. successful save should return a string to indicate the status.
2. if user tries to add again, return "already added", shouldn't return error.

Original comment by johnliu...@gmail.com on 13 Aug 2010 at 9:40