We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d21595 commit 0cbab21Copy full SHA for 0cbab21
netlify/edge-functions/utils.ts
@@ -37,6 +37,8 @@ export async function generateShortUrl(longUrl: string): Promise<string> {
37
throw error;
38
}
39
if (data && data[0]?.short_url) {
40
+ console.log("data");
41
+ console.log(data);
42
return data[0].short_url;
43
44
let shortUrl: string;
@@ -51,9 +53,9 @@ export async function generateShortUrl(longUrl: string): Promise<string> {
51
53
console.error("Error checking for collision:", error);
52
54
55
56
57
console.log(data);
- console.log(error);
- isCollision = data.length > 0;
58
+ isCollision = !!data;
59
60
({ data, error } = await fetchFromSupabase("urls", {
61
method: "POST",
0 commit comments