import Common from "../../common/Common.js";

export default {
    /**
     * 查询班组
     * @return {[type]} [description]
     */
    listGroup: function(organizationId) {
        return new Promise((resolve, reject) => {
            $.ajax({
                url: Common.getApiURL("groupResource/getGroupByOrganization"),
                type: "GET",
                dataType: "json",
                async:false,
                data:{
                    "organizationId":organizationId
                },
                beforeSend: function(request) {
                    Common.addTokenToRequest(request);
                },
                success: function(data){
                    resolve(data);
                },
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    Common.processException(XMLHttpRequest, textStatus, errorThrown);
                    reject();
                }
            });
        })
    },
}