- Setup todos tracking with axios and backend

This commit is contained in:
RemiSaurel
2022-08-29 22:26:30 +02:00
parent f98e77f552
commit a16354d6a7
3 changed files with 55 additions and 17 deletions
+5
View File
@@ -26,6 +26,8 @@
</template>
<script>
const HEROKU_URL = 'https://workspace-backend.herokuapp.com/';
import axios from "axios";
export default {
name: "ToDoList",
@@ -57,6 +59,9 @@ export default {
this.clearItem()
this.saveCurrentItems()
localStorage.setItem("nbItemsFinished", this.$store.getters.itemsFinished.length);
axios.post(HEROKU_URL + 'todos', {
title: item.text,
})
},
clearItem() {
this.item = ""