Skip to content

Commit d802a29

Browse files
authored
Merge pull request #1163 from CVEProject/tat-41
#41 Use CVE Services API to get CVE record count
2 parents 9a56f11 + b556be7 commit d802a29

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/views/Home.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,15 @@ export default {
7676
this.getCVERecordsCount();
7777
},
7878
computed: {
79-
API_BASE() { return this.$store.state.API_BASE; },
79+
CVE_SERVICES_API_BASE() { return this.$store.state.CVE_SERVICES_API_BASE; },
8080
},
8181
methods: {
8282
getCVERecordsCount() {
83+
console.log(`${this.CVE_SERVICES_API_BASE}/api/cve?count_only=1`);
8384
axios
84-
.get(`${this.API_BASE}cve-count.json`, { timeout: 30000 })
85+
.get(`${this.CVE_SERVICES_API_BASE}/api/cve?count_only=1`, { timeout: 30000 })
8586
.then((res) => {
86-
let count = this.$sanitize(res.data.count);
87+
let count = this.$sanitize(res.data.totalCount);
8788
count = this.$sanitize(count);
8889
count = parseInt(count, 10);
8990

0 commit comments

Comments
 (0)