summaryrefslogtreecommitdiff
path: root/src/store.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/store.js')
-rw-r--r--src/store.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/store.js b/src/store.js
index 1483402..51dfc91 100644
--- a/src/store.js
+++ b/src/store.js
@@ -134,6 +134,21 @@ export default new Vuex.Store({
async set_committer({commit}, avatar) {
commit('load_committer_avatar', avatar);
},
+ // Add new repository
+ async add_repo({commit}, payload) {
+ commit('loading_state', true)
+ let res
+ await fetch(`${this.state.api}/repo/`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(payload),
+ })
+ .then(async response => {
+ res = await response.json()
+ })
+ commit('loading_state', false)
+ return res
+ },
// Set loading state
async set_loading({commit}, status) {
commit('loading_state', status);