Prazen buffer v novem pojmu, faktoriranje
parent
ba4ec35410
commit
1b0f6ab4ed
|
@ -1,3 +1,4 @@
|
||||||
|
// @TODO preimenuj v api.js, dodaj helperje se za json fetch / naš api
|
||||||
export const useEtherpadApi = () => {
|
export const useEtherpadApi = () => {
|
||||||
const { baseUrl } = useRuntimeConfig().public
|
const { baseUrl } = useRuntimeConfig().public
|
||||||
const etherpadApiUrl = `${baseUrl}/etherpad-api`
|
const etherpadApiUrl = `${baseUrl}/etherpad-api`
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup="setup">
|
<script setup="setup">
|
||||||
|
|
||||||
const { getRandomUUID } = useCrypto()
|
const { getRandomUUID } = useCrypto()
|
||||||
const { etherpadApiUrl } = useEtherpadApi()
|
const { etherFetch } = useEtherpadApi()
|
||||||
const { poskrolaj } = useUi()
|
const { poskrolaj } = useUi()
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
@ -13,8 +13,10 @@ revisionId.value = route.params.guid ? route.params.guid : getRandomUUID()
|
||||||
|
|
||||||
// Ustvari nov, prazen pad
|
// Ustvari nov, prazen pad
|
||||||
// @TODO parameter za seranje linka?
|
// @TODO parameter za seranje linka?
|
||||||
const padId = revisionId.value
|
const resp = await etherFetch('/createPad', {
|
||||||
const resp = await $fetch(`${etherpadApiUrl}/createPad?padID=${padId}`)
|
padID: revisionId.value,
|
||||||
|
text: ''
|
||||||
|
})
|
||||||
|
|
||||||
const onZapri = () => { navigateTo('/manifest#skrol') }
|
const onZapri = () => { navigateTo('/manifest#skrol') }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue