Add binding for reloading deals

This commit is contained in:
Dave Gallant
2022-08-19 17:55:55 +00:00
parent 5e40b36232
commit a9110b0439
2 changed files with 23 additions and 10 deletions

View File

@@ -62,21 +62,25 @@ export default {
}, },
mounted() { mounted() {
this.isLoading = true; this.isLoading = true;
axios this.fetchDeals();
.get("http://localhost:8081/api/v1/topics") Mousetrap.bind("/", this.focusSearch, "keyup");
.then((response) => { Mousetrap.bind("r", this.loadDeals);
this.topics = response.data;
this.isLoading = false;
})
.catch((err) => {
console.log(err.response);
});
Mousetrap.bind("/", this.focusSearch);
}, },
methods: { methods: {
focusSearch() { focusSearch() {
this.$refs.search.focus(); this.$refs.search.focus();
}, },
fetchDeals() {
axios
.get("http://localhost:8081/api/v1/topics")
.then((response) => {
this.topics = response.data;
this.isLoading = false;
})
.catch((err) => {
console.log(err.response);
});
},
}, },
props: ["date"], props: ["date"],
computed: { computed: {

View File

@@ -6,3 +6,12 @@ body {
position: sticky; position: sticky;
top: 0; top: 0;
} }
.form-control {
border-color: #404142;
}
.form-control:focus {
color: #ccc !important;
background-color: #404142 !important;
}