summaryrefslogtreecommitdiff
path: root/src/store.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/store.js')
-rw-r--r--src/store.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/store.js b/src/store.js
index 98a4417..1afad67 100644
--- a/src/store.js
+++ b/src/store.js
@@ -69,9 +69,13 @@ export default new Vuex.Store({
},
actions: {
// Get all commits from the api backend
- async get_commits({commit}) {
+ async get_commits({commit}, query) {
commit('loading_state', true)
- await fetch(`${this.state.api}/commit/`)
+ let path = `${this.state.api}/commit/`
+ if(query) {
+ path += `?q=${query}`
+ }
+ await fetch(path)
.then(async response => {
commit('load_commits', await response.json());
})