vercel / next-learn

Learn Next.js Starter Code
https://next-learn-dashboard.vercel.sh/
MIT License
3.68k stars 1.89k forks source link

chapter 7: fetching data from latest invoice #777

Open Kofiastro opened 3 months ago

Kofiastro commented 3 months ago

After fetching data from latest invoice section it loops through one particular name of customer 5 times without generating 5 different names of customers with different description.

Screenshot 2024-06-30 at 15 31 06
CutlerRU commented 3 months ago

I am not getting this result. I would suggest double checking the data.ts scripts or maybe something is not being passed correctly to the LatestInvoices component. You could also try copying the original latest-invoices.tsx to see if that resolves this issue.

I only followed the steps provided in Chapter 7. If the code changes don't fix it, you could also try re-seeding your database.

image

Kofiastro commented 3 months ago

I copied the new placeholder-data.tsx, data.ts .I tried re-seeding. Still getting the same issue. @CutlerRU if you can share your files for me to use that instead.

Khodijah99 commented 3 months ago

After fetching data from latest invoice section it loops through one particular name of customer 5 times without generating 5 different names of customers with different description. Screenshot 2024-06-30 at 15 31 06

I'm having the same problem. How can we solve this, please?

Malavsp commented 3 months ago

@Kofiastro @Khodijah99 As you had already connected to vercel postgresDB then, try to delete all tables by writing query as below

DROP TABLE USERS, CUSTOMERS, INVOICES, REVENUE

And re-seed by running

npm run seed

or

pnpm seed 

Hope it solves the problem.

FantaBamboocha commented 3 weeks ago

I also encountered a similar issue with duplicate query results. However, when accessing the database directly, there were no problems. I deleted the database and re-seed it, but that didn't solve the issue. Checking the 'Disable cache' option in the 'Network' tab resolved the problem.