Skip to content
Snippets Groups Projects
Commit a8f6f444 authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Fix counting of Answers for Rooms

parent 5b4decb5
1 merge request!89Foundation for development of version 3.0
......@@ -170,7 +170,9 @@ public class CouchDbAnswerRepository extends CouchDbCrudRepository<Answer> imple
@Override
public int countByRoomId(final String roomId) {
final ViewResult result = db.queryView(createQuery("by_roomid_variant").key(roomId));
final ViewResult result = db.queryView(createQuery("by_roomid")
.key(roomId)
.reduce(true));
return result.isEmpty() ? 0 : result.getRows().get(0).getValueAsInt();
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment