2023-11-12 22:55:24 +01:00
|
|
|
<script setup="setup">
|
|
|
|
|
2023-12-16 01:53:05 +01:00
|
|
|
const { etherpadApiUrl } = useEtherpadApi()
|
2023-11-12 23:46:57 +01:00
|
|
|
|
2023-11-12 22:55:24 +01:00
|
|
|
const prikazi = ref(false)
|
|
|
|
const revisionId = ref(null)
|
|
|
|
|
2023-11-12 23:46:57 +01:00
|
|
|
const dodajPojem = async () => {
|
2023-11-12 22:55:24 +01:00
|
|
|
revisionId.value = crypto.randomUUID()
|
2023-11-12 23:46:57 +01:00
|
|
|
|
|
|
|
// Ustvari nov, prazen pad
|
2023-12-16 01:53:05 +01:00
|
|
|
const padId = revisionId.value
|
|
|
|
const resp = await $fetch(`${etherpadApiUrl}/createPad?padID=${padId}`)
|
2023-11-12 22:55:24 +01:00
|
|
|
prikazi.value = true
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
2023-06-15 20:45:38 +02:00
|
|
|
<template>
|
2023-11-12 22:55:24 +01:00
|
|
|
<div>
|
|
|
|
<div class="gumb" @click="dodajPojem()">
|
2023-06-15 20:45:38 +02:00
|
|
|
Dodaj pojem
|
2023-11-12 22:55:24 +01:00
|
|
|
</div>
|
2024-01-17 20:37:09 +01:00
|
|
|
<section class="pojem" v-if="prikazi">
|
|
|
|
<PojemForm :pojem="{}" :revisionId="revisionId" />
|
|
|
|
</section>
|
2023-11-12 22:55:24 +01:00
|
|
|
</div>
|
2023-06-15 20:45:38 +02:00
|
|
|
</template>
|