Strapi issue.
I am trying to replicate the invoice generator from here: https://refine.dev/blog/refine-react-admin-invoice-genarator/ everything was okay until Company list page, while i am able to login using my username and password for a strange reason when Your companies loads there are no data to show even if I added a company from Strapi backend. Any ideas? Thanks in advance! 🙂
Develop your Own Customizable Invoice Generator with Refine and Str...
Looking for an invoice generator? Try out Refine. With our custom interface, you can build your own invoice in minutes! Learn more here.
34 Replies
Hey @.happy3 ,
Could it be related to permissions? Does the user you log in with have GET permissions for company collection? 👀
wee-brownOP•3y ago
Good morning, sorry for the late response, here are my settings, the issue I am facing from the UI and console log i get.
Could you share your network tab?
wee-brownOP•3y ago
Sure!
wee-brownOP•3y ago
and this is when i call it in source code
Could you share
companies
request on your network tab?wee-brownOP•3y ago
here
wee-brownOP•3y ago
api calls seems okay!
everything looks correct.
Can you compare your code with this?
https://github.com/pankod/refine/blob/next/examples/blog/invoiceGenerator/src/pages/company/list.tsx
wee-brownOP•3y ago
Sure i will give it a try again!
by the way, could your field names be different with the example?
wee-brownOP•3y ago
Good morning! Connected the example from github to my strapi instance. Still facing the same issue, I will read more on strapi documentation maybe i can find the problem there.
Could you share response tab of "companies" request?
wee-brownOP•3y ago
also i tried contacts, I am able to add contacts in strapi from frontend, it creates an empty record, and if I add a record in backend it is not displayed on frontend
Could you share "Response" tab of Network request?
wee-brownOP•3y ago
Hey,
We've added a Live example to our blog post and the example works as expected.
https://refine.dev/blog/refine-invoice-generator/#live-stackblitz-example
Could you compare your code with the example project?
Building an Customizable Invoice Generator App with Refine, Strapi ...
Looking for an invoice generator? Try out Refine. With our custom interface, you can build your own invoice in minutes! Learn more here.
wee-brownOP•3y ago
Sure thank you! 🙂
Works perfect. With the working example i found out that tha issue was from strapi end. Installed a new instance set it up etc and works.
Hooraayy!!
rising-crimson•3y ago
can you tell me how you fixed strapi? I am facing the same issue, the code works if API_URL is equal to refines api endpoint. but when i connect it to localhost:1337 i get this same screen you sent earlier. thanks for your help 🙂
Hey @.happy3 👋,
Could you help?
wee-brownOP•3y ago
Good morning! Sure! @rogueripple do you have your code in a git repository? From what I can see from your screenshot you get the email but not the rest of the fields. First update Strapi to the latest and check your api names that are correct. If you just cloned the repo and created the strapi instance, maybe it will better and easier if I provide you with a step by step instructions on how to set it up from the start. Give it a try and if you still facing this issue do not hesitate to contact us!
rising-crimson•3y ago
Thanks for your quick response @.happy3 , here is the strapi backend i spun up https://github.com/emtechgroup/strapi-invoice and here is the frontend i cloned from refine example https://github.com/emtechgroup/invoice-frontend
wee-brownOP•3y ago
I will have a look as soon as I arrive at the office! 🙂
Hey @rogueripple 👋 ,
Wow, I didn't know about this repo. Where did you find it?
rising-crimson•3y ago
so i was able to get company data to show up when i went into strapi gui backend and changed the input fields from capital to lowercase ie: Name to name, Address to address, etc. logo is still not showing yet, for the client page i am able to write to db but after submitting the frontend page goes white, so i have to go into strapi gui and remove the client data to unbreak the site. and under the contact page i am able to write to db but the option for choosing company does not give option to add company to the dataset
rising-crimson•3y ago
@Omer i think i pulled the invoicegenerator code from here https://github.com/refinedev/refine/tree/master/examples/blog/invoiceGenerator
have you tried using this?
https://github.com/emtechgroup/invoice-frontend
GitHub
GitHub - emtechgroup/invoice-frontend: refine invoice generator fro...
refine invoice generator frontend. Contribute to emtechgroup/invoice-frontend development by creating an account on GitHub.
rising-crimson•3y ago
yes that is my repo i uploaded earlier so Happy could take a look at the code for the frontend error i posted. that emtechgroup/invoice-frontend repo is a clone of refine/tree/master/examples/blog/invoiceGenerator
hmm, will it be helpful if I share the
api
folder of our Strapi backend ?rising-crimson•3y ago
yes! i think this will allow me to check my strapi code to ensure i am configuring it to work correctly with your invoicegenerator frontend. I would very much appreciate it.
wee-brownOP•3y ago
Btw for the image issue you should run strapi as production, had the same issue.
@rogueripple did you solve the issue?
rising-crimson•3y ago
@.happy3 yes sir, thank you Happy and thank you @Omer , i was able to see the api folder and get strapi configured correctly locally.
now i get to go through code further and try to master refine and strapi. this platform is amazing for wannabe coders!!! thank you guys!