Answer the question
In order to leave comments, you need to log in
How to display logos according to id?
Good day!
There are two tables in the database,
the first is "projects" the
second is "company"
In the first I store a list of projects, in the second the companies that these projects ordered
In the second, the name of the company and a link to the logo
But when I create a project, selecting the customer company , all logos are displayed...
const onGetCompanyListDetails = () => {
return projectsList.map(projects => {
const logoUrl = companyList.find(i => i.id === projects.companyId).imgUrl;
return <img key={projects.id} src={logoUrl} />
});
};
Answer the question
In order to leave comments, you need to log in
Better make companyName a separate endpoint. Those.
/company/companyName/id,url,imgUrl.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question