$(function () {
    console.log('Fire', userName)
    fn_GetDistributors()
})


async function fn_GetDistributors() {
    var res = await fn_GetAsyncCall(`/api/settings/distributor/${userName}/`);
    let html = '<option value="">Select</option>'
    if (res.ok > 0) {
        $.each(res.data, function () {
            html += `<option value="${this.id}">${this.name}</option>`
        })
    }
    else {
        html = `<option value="">${fn_StringfyError(res.error)}</option>`
    }

    $(`#id_distributor`).empty().append(html)

}

