var NotifyPushTestForm = function(){};

/***
 * Init the form
 * @returns {undefined}
 */
NotifyPushTestForm.Init = function(){
    Event.AddById("btnSendPush", "click", NotifyPushTestForm.SendPush);
};

/***
* Get the Id of element 
*/
NotifyPushTestForm.GetId = function(){
    return Form.GetId("NotifyPushTestFormForm");
};

/*
* Save the Element
*/
NotifyPushTestForm.SendPush = function(e){
   
    if(Form.IsValid("NotifyPushTestFormForm"))
    {
    let request = new Http("Notify", "SendPush");
        request.SetData(Form.Serialize("NotifyPushTestFormForm"));

        request.Post(data => {

            data = JSON.parse(data);

            if(data.status == "error"){
                Form.RenderError("NotifyPushTestFormForm", data.data.message);
            } 
        });
    }
};

