Formatting

This commit is contained in:
2025-06-28 00:15:51 +02:00
parent 0088b8f02a
commit 4ac986745d
22 changed files with 1180 additions and 1245 deletions

View File

@@ -1,10 +1,10 @@
"use server"
import { revalidatePath } from "next/cache"
import { getSession } from "../auth/session"
import { insertUrl } from "../db/urls"
import { advancedUrlSchema, editUrlSchema, urlFormSchema } from "../schema/url"
import { deleteUrl as deleteUrlDb, updateUrl as updateUrlDb } from "../db/urls"
import { revalidatePath } from "next/cache"
import { advancedUrlSchema, editUrlSchema, urlFormSchema } from "../schema/url"
import { getWebsiteTitle } from "../websiteTitle"
type Response = {
@@ -68,7 +68,7 @@ export async function createAdvanceUrl(unsafeData: unknown): Promise<Response> {
...data,
slug: data.slug?.length === 0 ? undefined : data.slug,
title: data.title?.length === 0 ? await getWebsiteTitle(data.url) : data.title,
maxVisits: data.maxVisits > 0 ? data.maxVisits : undefined,
maxVisits: data.maxVisits > 0 ? data.maxVisits : undefined
})
return {
@@ -120,4 +120,4 @@ export async function deleteUrl(id: string): Promise<Response> {
error: false,
message: "Short link deleted successfully!"
}
}
}