new getGroupsPosts function