More basics for the shorturl creation module

This commit is contained in:
Nicolai Ort 2021-08-21 10:56:44 +02:00
parent 0c629e2416
commit 515370eac7
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F
1 changed files with 107 additions and 94 deletions

View File

@ -1,11 +1,23 @@
<script>
import Apiclient from "./Apiclient";
$: targetUrl = '';
$: customShortcode = '';
$: shortcode = '';
$: error = '';
function createUrl() {
console.log("here")
Apiclient.createUrl(targetUrl, shortcode).then((res)=>{
console.log(res)
if(res.status != 200){
error = res.data;
}
else{
shortcode = res.data.shortcode;
}
});
}
function reset() {
@ -77,7 +89,7 @@
</div>
</div>
{:else}
TODO:
<!-- TODO: -->
{/if}
<div class="mt-3 mx-auto text-center lg:w-1/3 w-full">
{#if shortcode == ''}
@ -96,3 +108,4 @@
</button>
{/if}
</div>