Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
 
 
 
 
 
 

30 linhas
658 B

  1. <template>
  2. <Dialog @close="() => $emit('close')">
  3. <h3>Are you sure you want to unsubscribe?</h3>
  4. <button @click="() => $emit('close')">Cancel</button>
  5. <button @click="unsubscribe">Confirm</button>
  6. </Dialog>
  7. </template>
  8. <script setup>
  9. import Dialog from "./dialog.vue"
  10. const emit = defineEmits(['close'])
  11. const props = defineProps(['token'])
  12. function unsubscribe() {
  13. console.log(props.user)
  14. fetch(`/api/user/unsubscribe`,
  15. {method: 'GET',
  16. headers: {
  17. "Accept": "application/json",
  18. "Authorization": `Bearer ${props.token}`,
  19. },
  20. }).then(resp => {
  21. if (resp.ok) emit('updateUser')
  22. })
  23. }
  24. </script>