move the commit into the try/catch block

This commit is contained in:
Andreas Zweili 2021-07-28 16:57:54 +02:00
parent d716c7efd0
commit f1ed21f3f0
1 changed files with 7 additions and 5 deletions

View File

@ -14,13 +14,15 @@ export default {
try {
await getAPI.put(`coaches/${userId}.json`, coachData);
context.commit('registerCoach', {
...coachData,
id: userId
});
} catch (err) {
console.log(err.response.status);
}
} catch (err) {
console.log(err.response.status);
}
context.commit('registerCoach', {
...coachData,
id: userId
});
}
};