From 4f7311d02b12e537d6c60f583be6d24275761bd0 Mon Sep 17 00:00:00 2001 From: Ayo Date: Fri, 12 May 2023 08:49:06 +0200 Subject: [PATCH] refactor: clean code --- src/pages/index.astro | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/index.astro b/src/pages/index.astro index d625d74..c907829 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -6,14 +6,13 @@ import { getParams, isURL } from "../utils"; import Post from "../components/post.astro"; const params = getParams(Astro.url); -const url: string = params?.url; +const url: string = params?.url || ""; const article = isURL(url) && (await extract(url)); const form = new FormGroup([ { - type: "text", name: "url", - value: url || "", + value: url, placeholder: "Put the URL here", validators: [Validators.required, Validators.minLength(11)], },