-
-
+ 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() {
+ error = '';
+ shortcode = '';
+ customShortcode = '';
+ targetUrl = '';
+ }
+
+
+
Create new url
+ {#if error != ""}
+
+
+
+
+
+
+
+
-
-{/if}
-{#if shortcode == ''}
-
-{:else}
- TODO:
-{/if}
-
- {#if shortcode == ''}
-
- {:else}
-
- {/if}
-
+ {/if}
+ {#if shortcode == ''}
+
+ {:else}
+
+ {/if}
+
+ {#if shortcode == ''}
+
+ {:else}
+
+ {/if}
+
+
\ No newline at end of file