Javascript – API is called twice
I have app about hockey statistics, I dont have endpoint with this stats , I have endpoint with team and player stats. I am calling api with first team , select first 2 players save to arr and call api…
I have app about hockey statistics, I dont have endpoint with this stats , I have endpoint with team and player stats. I am calling api with first team , select first 2 players save to arr and call api…
In my NextJS v14 project I would like to create a Dynamo db record every time a user signs up. So, I followed this official AWS tutorial, but I stumbled upon few hiccups, like: When I run amplify update function…
I'm new to next.js I don't understand why metadata variable is exported from Layout file and not importing it anywhere import "./globals.css"; export const metadata = { title: "NextJS App", description: "Your first NextJS app!", }; export default function Layout({…
I am a bit confused between the 2 events: checkout.session.async_payment_succeeded & checkout.session.completed I'm currently using checkout.session.completed so I'm curious if checkout.session.async_payment_succeeded sends any events that are not handled by checkout.session.completed. My current code looks like: const session = event.data.object as…
I am trying to iterate over the response I get from an API using the map() method but I keep getting the error 'drinks.map is not a function'. Below is my code Drinks import DrinksList from "@/components/DrinksList"; const url =…
Im trying to import an object containing reusable TailwindCSS classes and reuse these classes across my app. For some reason I need to copy + paste this object locally INSIDE the react component I want to use it in for…
I've built a website with Nextjs (using version 12.1.4). For SEO purposes I would like to make a permanent redirect for my www version of the site to my non-www. Normally this could easily be done with nginx or an…
I'm trying to use useFormStatus() to change UI dynamically when the form is submitted and it's waiting to fetch the data. I have a form component like function onSubmit(data: z.infer<typeof FormSchema>) { requestImg(data).then((imageStringify) => { const binaryData = Buffer.from(imageStringify.image); const…
I developed an API using Django-REST Framework and am trying to connect it with my frontend. I have an endpoint to get the last four winners, and when I try it works alright async function getLastFourWinners() { const url =…
I use the newest version of nextjs with app router, and I'm a little bit stuck with route organization. I need routing like that, but can`t figure out how to do it catalog/[category]/[id] ===> id.jsx catalog/[category] ===> catalog.jsx catalog ===>…