1
|
|
2
|
// certificate listing app VUE instance
|
3
|
var certificateListingApp = new Vue({
|
4
|
el: "#certificateListingPage",
|
5
|
data: {
|
6
|
// list of all certificates to be displayed in the list
|
7
|
certificates: []
|
8
|
}
|
9
|
});
|
10
|
|
11
|
// download a list of all available certificates and display them in the table
|
12
|
axios.get(API_URL + "certificates")
|
13
|
.then(function (response) {
|
14
|
if (response.data["success"])
|
15
|
response.data["data"].forEach(item => certificateListingApp.certificates.push(item))
|
16
|
else
|
17
|
console.log("Error occured while loading certificate list") // TODO more action may be required
|
18
|
})
|
19
|
.catch(function (error) {
|
20
|
console.log(error);
|
21
|
});
|