Working on recommendations

This commit is contained in:
Eclypsed
2024-02-08 21:47:54 -05:00
parent f127087791
commit 09a23fe363
4 changed files with 38 additions and 23 deletions

View File

@@ -1,9 +1,7 @@
import { SECRET_INTERNAL_API_KEY } from '$env/static/private'
import type { PageServerLoad } from './$types'
export const prerender = false
export const load: PageServerLoad = async ({ locals, fetch, url }) => {
export const load: PageServerLoad = async ({ locals, fetch }) => {
const recommendationResponse = await fetch(`/api/users/${locals.user.id}/recommendations`, { headers: { apikey: SECRET_INTERNAL_API_KEY } })
const recommendationData = await recommendationResponse.json()
const { recommendations } = recommendationData

View File

@@ -1,5 +1,7 @@
import type { LayoutServerLoad } from './$types'
export const ssr = false
export const load: LayoutServerLoad = ({ url, locals }) => {
const { pathname, search } = url
return {

View File

@@ -3,7 +3,7 @@
import IconButton from '$lib/components/util/iconButton.svelte'
import Toggle from '$lib/components/util/toggle.svelte'
import type { SubmitFunction } from '@sveltejs/kit'
import { fly } from 'svelte/transition'
import { fly, scale } from 'svelte/transition'
import { enhance } from '$app/forms'
export let connection: Connection
@@ -31,7 +31,13 @@
<i slot="icon" class="fa-solid fa-link-slash" />
</IconButton>
{#if showUnlinkModal}
<form use:enhance={submitFunction} action="?/deleteConnection" method="post" class="absolute right-full top-0 flex -translate-x-3 flex-col items-center justify-center gap-3 rounded-md bg-neutral-925 p-4">
<form
transition:scale={{ start: 0.5 }}
use:enhance={submitFunction}
action="?/deleteConnection"
method="post"
class="absolute right-full top-0 flex -translate-x-3 flex-col items-center justify-center gap-3 rounded-md bg-neutral-925 p-4"
>
<span class="whitespace-nowrap">Delete Connection</span>
<div class="flex gap-4">
<button class="w-20 rounded-md bg-red-500 px-2 py-1">Confirm</button>