mirror of
https://github.com/kevin-DL/build-gmail-clone-with-vue-3.git
synced 2026-01-21 14:55:00 +00:00
Start of lesson 14 (rebase into next commit)
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user