<script setup lang="ts">
import { ref } from "vue";
import UiParentCard from "@/components/shared/UiParentCard.vue";
import { useSidebarStore } from "~/stores/api/sidebar";
const { getSidebar } = useSidebarStore()
const runtime = useRuntimeConfig();
const { session, refresh, update, reset, overwrite } = await useSession()


const sidebar = async () => {
  console.log('erwer')
  // await overwrite({ "test": "This replaces all current data of the session without overwriting the current session itself" })

  console.log(session.value)
  // const a = await getSidebar()
  const res = await $fetch(`http://10.10.150.131:8080/api/login/6835632801e46cf9c5551876`, {
    // mode: 'no-cors',
    headers: {
      'Access-Control-Allow-Origin': '*',
      'Content-Type': 'application/json',
    },
    withCredentials: true,
    credentials: 'include',
  })
    .then((response) => {
      console.log(response)
    })
}

const resett = async () => {
  await reset()
}
</script>
<template>
  <v-row>
    <v-col cols="12" md="12">
      <v-card elevation="10">
        <v-card-item>
          <h5 class="text-h5 mb-3">Sample Page</h5>
          <p class="text-body-1">This is a sample page</p>
          <v-btn @click="sidebar" color="primary" size="large" block flat>get</v-btn>
          <v-btn @click="resett" color="primary" size="large" block flat>reset</v-btn>
        </v-card-item>
      </v-card>
    </v-col>
  </v-row>
</template>
