From 78dc7be703bd574aeb376ae1a295421311f3218c Mon Sep 17 00:00:00 2001 From: Mark Hoekveen Date: Fri, 1 Aug 2025 21:17:12 +0200 Subject: [PATCH] fixes?? nominations?? --- frontend/src/app/nominations/page.tsx | 45 ++++++++++++++++++++++++--- frontend/src/data/fetcher.ts | 2 ++ 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/nominations/page.tsx b/frontend/src/app/nominations/page.tsx index 1d2c23f..b8e5772 100644 --- a/frontend/src/app/nominations/page.tsx +++ b/frontend/src/app/nominations/page.tsx @@ -1,14 +1,31 @@ "use client"; import { useState } from "react"; import { Nunito } from "next/font/google"; +import { api } from "muzak/data/fetcher"; const nunito = Nunito({ weight: "900", subsets: ["latin"], }); +async function nominate(spotifyLink: string) { + console.log(spotifyLink); + try { + const response = await api.tracks.nominate({ + spotify_link: spotifyLink, + }); + console.log("Nomination successful:", response); + return { success: true, data: response.data }; + } catch (error) { + console.error("Nomination failed:", error); + return { success: false, error }; + } +} + export default function Nominations() { const [songURL, setSongURL] = useState(""); + const [isLoading, setIsLoading] = useState(false); + const [message, setMessage] = useState(""); return (
@@ -33,16 +50,36 @@ export default function Nominations() { + {message && ( +
+ {message} +
+ )}