Start of lesson 14 (rebase into next commit)

This commit is contained in:
Jeffrey Biles
2020-08-18 00:05:08 -07:00
parent f094e5db1a
commit 9c5275e7f6
3 changed files with 23 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
import { reactive } from 'vue';
import axios from 'axios';
let emails = reactive(new Set())
@@ -18,12 +19,19 @@ export const useEmailSelection = function(){
emails.add(email)
})
}
let markRead = () => {
emails.forEach((email) => {
email.read = true;
axios.put(`http://localhost:3000/emails/${email.id}`, email)
})
}
return {
emails,
toggle,
clear,
addMultiple
addMultiple,
markRead
}
}