Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

29 linhas
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>