Full implemantation
This commit is contained in:
@ -13,8 +13,13 @@
|
||||
get: function() {
|
||||
const uri = '/mailboxes/registered'
|
||||
this.draw().loading()
|
||||
return Send.get(uri).then(response => {
|
||||
this.mailboxes = response.mailboxes
|
||||
return Send.get(uri).then((response, status, jqXHR) => {
|
||||
if (parseInt(jqXHR.status / 100) !== 2) {
|
||||
return
|
||||
}
|
||||
if (jqXHR.status === 200) {
|
||||
this.mailboxes = response.mailboxes
|
||||
}
|
||||
this.draw().list()
|
||||
})
|
||||
},
|
||||
@ -38,6 +43,10 @@
|
||||
list: () => {
|
||||
const parent = $(this.div_id)
|
||||
parent.html('')
|
||||
if (this.mailboxes.length === 0) {
|
||||
parent.html('No mailboxes registered.')
|
||||
return
|
||||
}
|
||||
const list = $('<div></div>').addClass('ui list')
|
||||
this.mailboxes.forEach(mb => {
|
||||
list.append(
|
||||
|
Reference in New Issue
Block a user