refactor: everything except product page

This commit is contained in:
Tobias Klemp
2025-11-29 22:48:58 +01:00
parent 6d03984e21
commit 42080520bf
41 changed files with 8 additions and 2061 deletions

View File

@@ -1,5 +1,4 @@
<script lang="ts">
import * as Carousel from '$lib/components/ui/carousel'
import { Badge, type BadgeVariant } from '$lib/components/ui/badge'
import { Separator } from '$lib/components/ui/separator'
import ColorVariations from '$lib/components/ui/variations/ColorVariations.svelte'
@@ -17,12 +16,6 @@
import type { ImageCarouselItem } from '$lib/components/ui/image-carousel'
import { ShopList, type TShopListItem } from '$lib/components/ui/shopList'
async function crawlClevertronik() {
const response = await fetch('/crawl', { method: 'POST' })
const productName = await response.json()
console.log(productName)
}
type ProductBadge = {
text: string
variant: BadgeVariant

View File

@@ -1,22 +0,0 @@
import { crawlClevertronik } from '$lib/server/crawler/clevertronik'
import { json, error } from '@sveltejs/kit'
import { Effect } from 'effect'
export async function POST() {
try {
const pageContent = await Effect.runPromise(
crawlClevertronik.pipe(Effect.annotateLogs({ route: 'crawl' })),
)
return json(pageContent)
} catch (e) {
if (
e &&
typeof e === 'object' &&
'message' in e &&
typeof e.message === 'string'
) {
return error(500, { message: e.message })
}
return error(500, { message: 'Internal Error' })
}
}