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 = () => {
|
||||
const { baseUrl } = useRuntimeConfig().public
|
||||
const etherpadApiUrl = `${baseUrl}/etherpad-api`
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script setup="setup">
|
||||
|
||||
const { getRandomUUID } = useCrypto()
|
||||
const { etherpadApiUrl } = useEtherpadApi()
|
||||
const { etherFetch } = useEtherpadApi()
|
||||
const { poskrolaj } = useUi()
|
||||
|
||||
const route = useRoute()
|
||||
|
@ -13,8 +13,10 @@ revisionId.value = route.params.guid ? route.params.guid : getRandomUUID()
|
|||
|
||||
// Ustvari nov, prazen pad
|
||||
// @TODO parameter za seranje linka?
|
||||
const padId = revisionId.value
|
||||
const resp = await $fetch(`${etherpadApiUrl}/createPad?padID=${padId}`)
|
||||
const resp = await etherFetch('/createPad', {
|
||||
padID: revisionId.value,
|
||||
text: ''
|
||||
})
|
||||
|
||||
const onZapri = () => { navigateTo('/manifest#skrol') }
|
||||
|
||||
|
|
Loading…
Reference in New Issue