From 9bbff6134c7068567a7a38b2de13472bff4c73e9 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 23 Mar 2021 21:30:34 +0100 Subject: feat: search page --- src/store.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/store.js') 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()); }) -- cgit v1.2.3-18-g5258