added first functions
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Artem Anufrij
2023-09-19 01:56:09 +02:00
parent 8248073a4d
commit 239b538c4b
4 changed files with 100 additions and 55 deletions

View File

@@ -80,6 +80,23 @@ export default {
context.commit("setHistory", res.data);
});
},
saveProgress(context, item) {
if (context.state._id == -1) {
return;
}
axios.post(context.rootGetters.server + "/api/user/progress", item, context.rootGetters.headers);
},
getProgress(context, parent) {
if (context.state._id == -1) {
return;
}
axios
.get(context.rootGetters.server + "/api/user/progress/" + parent._id, context.rootGetters.headers)
.then((res) => {
parent.progress = res.data;
});
},
savePlayerSettings(context) {
let body = {
repeat: context.rootGetters["player/repeatType"],