-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add /api/projects
endpoints
#34
Conversation
@swellander is attempting to deploy a commit to the BuidlGuidl Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
return data.map(item => ({ | ||
id: item.id, | ||
const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/stub/project_ids`); | ||
const data: Project[] = await response.json(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a string[] no a project[]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!
d97040a
to
b6cb5a9
Compare
to services/database
which uses OSO ids
to hit new endpoints
b6cb5a9
to
cabdf50
Compare
/api/stub/project_ids
endpoint/api/projects
endpoints
packages/firebase/seed.sample.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the seed sample file projects
with agora projects with OSO id mappings
I am going to dig in to why the build is still failing. This looks good so nice work! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing with two parts that made me have issues. Almost there. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file won't display for me due to lines 43-56 where [...data?.github, ...data?.packages]
. If the project doesn't have github
or packages
properties then the spread operator is trying to act upon undefined causing this error:
Error: (intermediate value) is not iterable
.
We should check for the existence of github
and packages
before using the spread operator.
I might need to reseed the production data for the build to succeed. I will give that a try when you commit the fixes I discussed in my review. |
if (!id) return res.status(400).json({ message: "Must include project ID" }); | ||
try { | ||
const projectDetail = await getProjectById(id); | ||
const projectDetailDto = convertProjectToDto(projectDetail); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The request from the project page needs more than the dto version. It needs the whole Project.
@swellander #46 has the seed data changes for projects covered. If it gets merged in before this then you can remove your changes to |
Closing this since all the relevant changes were absorbed by #46. Thanks for your help with this @swellander. |
Description
Creates the following endpoints to fetch project data from our db:
/api/projects
to return a list of all projects (closes API Definition [projects GET] #37)/api/projects/detail/{ID}
to return a single project (closes API Definition [ProjectById] #38)/api/projects/ids
to return a flat list of all project IDs for our static page generation