Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

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