More basics for the shorturl creation module
This commit is contained in:
parent
0c629e2416
commit
515370eac7
@ -1,11 +1,23 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import Apiclient from "./Apiclient";
|
||||||
|
|
||||||
|
|
||||||
$: targetUrl = '';
|
$: targetUrl = '';
|
||||||
$: customShortcode = '';
|
$: customShortcode = '';
|
||||||
$: shortcode = '';
|
$: shortcode = '';
|
||||||
$: error = '';
|
$: error = '';
|
||||||
|
|
||||||
function createUrl() {
|
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() {
|
function reset() {
|
||||||
@ -77,7 +89,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
TODO:
|
<!-- TODO: -->
|
||||||
{/if}
|
{/if}
|
||||||
<div class="mt-3 mx-auto text-center lg:w-1/3 w-full">
|
<div class="mt-3 mx-auto text-center lg:w-1/3 w-full">
|
||||||
{#if shortcode == ''}
|
{#if shortcode == ''}
|
||||||
@ -96,3 +108,4 @@
|
|||||||
</button>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user