|
|
@ -19,7 +19,7 @@ function loadListAdminList(){ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function loadListList(){ |
|
|
|
function loadListList(){ |
|
|
|
$.getJSON('/api/list/list', showListAdminList); |
|
|
|
$.getJSON('/api/list/list', showListList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function loadUserList(){ |
|
|
|
function loadUserList(){ |
|
|
@ -34,22 +34,9 @@ function showList(listEmail){ |
|
|
|
$.post('/api/list/show',{list:listEmail},showListResult,'json'); |
|
|
|
$.post('/api/list/show',{list:listEmail},showListResult,'json'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function showListResult(result){ |
|
|
|
|
|
|
|
console.log(result); |
|
|
|
|
|
|
|
if ('error' in result){ |
|
|
|
|
|
|
|
alert(result.error); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ('success' in result){ |
|
|
|
|
|
|
|
alert(result.success); |
|
|
|
|
|
|
|
reload(); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
alert("Api call did not return result"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function showListAdminList(data){ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function showListAdminList(data){ |
|
|
|
function showListAdminList(data){ |
|
|
|
for (let i in data.lists){ |
|
|
|
for (let i in data.lists){ |
|
|
@ -85,6 +72,33 @@ function showListAdminList(data){ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function showListList(data){ |
|
|
|
|
|
|
|
for (let i in data.lists){ |
|
|
|
|
|
|
|
let list = data.lists[i]; |
|
|
|
|
|
|
|
let row = $('<tr/>'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('<td/>').text(list.name).appendTo(row); |
|
|
|
|
|
|
|
$('<td/>').text(list.email).appendTo(row); |
|
|
|
|
|
|
|
$('<td/>').text(list.state).appendTo(row); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
row.appendTo('#listlist'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function showListResult(result){ |
|
|
|
|
|
|
|
console.log(result); |
|
|
|
|
|
|
|
if ('error' in result){ |
|
|
|
|
|
|
|
alert(result.error); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ('success' in result){ |
|
|
|
|
|
|
|
alert(result.success); |
|
|
|
|
|
|
|
reload(); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
alert("Api call did not return result"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function showUserList(data){ |
|
|
|
function showUserList(data){ |
|
|
|
for (let i in data.users){ |
|
|
|
for (let i in data.users){ |
|
|
|
let user = data.users[i]; |
|
|
|
let user = data.users[i]; |
|
|
|