Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

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