use of com.axelor.apps.base.db.MailingListMessage in project axelor-open-suite by axelor.
the class MailingListMessageBaseRepository method populate.
@Override
public Map<String, Object> populate(Map<String, Object> json, Map<String, Object> context) {
if (json != null && json.get("id") != null) {
final MailingListMessage entity = find((Long) json.get("id"));
final MailFollowerRepository followers = Beans.get(MailFollowerRepository.class);
final MailFollower follower = followers.findOne(entity, AuthUtils.getUser());
json.put("_following", follower != null && follower.getArchived() == Boolean.FALSE);
json.put("_image", entity.getImage() != null);
}
return json;
}
Aggregations