Package controllers.account.settings

Source Code of controllers.account.settings.Notifs

package controllers.account.settings;

import controllers.BaseController;
import models.User;

import com.fasterxml.jackson.databind.JsonNode;

import play.mvc.Controller;
import play.mvc.Result;
import securesocial.core.Identity;
import securesocial.core.java.SecureSocial;

@SecureSocial.SecuredAction(ajaxCall=true)
public class Notifs extends BaseController {

    public static Result save() {

        User user = getLoggedUser();

        JsonNode userJson = request().body().asJson();
        user.setNotifOnMyProposal(userJson.get("notifOnMyProposal").asBoolean());
        user.setNotifAdminOnAllProposal(userJson.get("notifAdminOnAllProposal").asBoolean());
        user.setNotifAdminOnProposalWithComment(userJson.get("notifAdminOnProposalWithComment").asBoolean());
        user.save();
        return ok();
    }
}
TOP

Related Classes of controllers.account.settings.Notifs

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.