summaryrefslogtreecommitdiff
path: root/store
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-09-19 21:02:33 +0200
committerSanto Cariotti <santo@dcariotti.me>2022-09-19 21:02:33 +0200
commit0a99b1d5da22b8fdec44d14b12377488091758f9 (patch)
treeb761e0e9927eabff2152ffadb53fef153cbfc1fd /store
parent6657722d68169ada3f36fff9455413f9cc6d6c53 (diff)
Model info page
Diffstat (limited to 'store')
-rw-r--r--store/models.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/store/models.js b/store/models.js
index e2a0e30..23c612e 100644
--- a/store/models.js
+++ b/store/models.js
@@ -49,4 +49,27 @@ export const actions = {
return res;
},
+ // Find a model by its id
+ async findModal({ commit }, id) {
+ commit("loadingStatus", true, { root: true });
+ let res = { status: 0, data: null };
+ let api = this.$config.api;
+
+ await fetch(`${api}/v1/models/${id}`, {
+ headers: {
+ "Content-Type": "application/json",
+ },
+ })
+ .then(async (response) => {
+ res.data = await response.json();
+ res.status = response.status;
+ })
+ .catch((e) => {
+ res.status = e.status;
+ });
+
+ commit("loadingStatus", false, { root: true });
+
+ return res;
+ },
};