Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

29 lignes
644 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', 'cancelSub'])
  11. const props = defineProps(['token'])
  12. function unsubscribe() {
  13. fetch(`/api/user/unsubscribe`,
  14. {method: 'GET',
  15. headers: {
  16. "Accept": "application/json",
  17. "Authorization": `Bearer ${props.token}`,
  18. },
  19. }).then(resp => {
  20. if (resp.ok) emit('cancelSub')
  21. })
  22. }
  23. </script>