/**
 * Send Message js in send-message.html
 *
 * @since 1.0 check web
 */
var SendMessage = {};

SendMessage.baseApiUrl = CONSTANT.URL.CMS.BASE + ClientData.userInfo_accountPath() + CONSTANT.URL.CMS.API.BASE + 'sendMessage/';

/**
 * default JSON
 */
 SendMessage.dummyJson = {
    
}

/**
 * get data from cms
 * @param {function} callback 
 */
 SendMessage.getData = function (callback) {
    let param = {
        sid: COMMON.getSid(),
    };
    const url = SendMessage.baseApiUrl;
    COMMON.cmsAjax(url, param, false, function (json) {
        if (callback) {
            callback(json);
        }
    }, function() {
        console.log('SendMessage.getData error');
        if (callback) {
            callback(SendMessage.dummyJson);
        }
    });
};

/**
 * init data, action when screen onload
 */
SendMessage.init = function () {
    $("#includedHeader").load("../common/header.html" , function() {
        I18N.initi18n();
    });
};