1 |
e75db9cd
|
Jan Pašek
|
|
2 |
6c9cb54a
|
Jan Pašek
|
// certificate listing app VUE instance
|
3 |
e75db9cd
|
Jan Pašek
|
var certificateListingApp = new Vue({
|
4 |
|
|
el: "#certificateListingPage",
|
5 |
|
|
data: {
|
6 |
6c9cb54a
|
Jan Pašek
|
// list of all certificates to be displayed in the list
|
7 |
e75db9cd
|
Jan Pašek
|
certificates: []
|
8 |
|
|
}
|
9 |
|
|
});
|
10 |
|
|
|
11 |
6c9cb54a
|
Jan Pašek
|
// download a list of all available certificates and display them in the table
|
12 |
28787717
|
Jan Pašek
|
axios.get(API_URL + "certificates")
|
13 |
e75db9cd
|
Jan Pašek
|
.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 |
6c9cb54a
|
Jan Pašek
|
});
|