Skip to content
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

Fetch detailed information about each project #1

Merged
merged 4 commits into from
Feb 21, 2018
Merged

Fetch detailed information about each project #1

merged 4 commits into from
Feb 21, 2018

Conversation

S3B4S
Copy link
Contributor

@S3B4S S3B4S commented Feb 13, 2018

Having an axios request inside of the projects.map simply wouldn't generate a schema for me. By adding it outside of that it would work. However, I noticed that the detailed information of each project (/projects/:projectID) would include all the information that is present in the general information of all the projects (/users/:userName/projects). So it made more sense to me to simply extract all of the information from the detailed information about each project.

Also, to get around the keys-being-numbers issue I broke the keys down into arrays with strings as keys. I think the naming could perhaps be better in some places.

Let me know if it works / what you think! 👍

@S3B4S
Copy link
Contributor Author

S3B4S commented Feb 13, 2018

I just noticed there is a breaking change 😕
The cover field has been removed, as it has been turned into an array now: https://github.com/LeKoArts/gatsby-source-behance/pull/1/files#diff-b795d1c35ffc98dcf589692c744446ceL57.

I'm not really sure what the appropriate way is to handle this, if people are actively using this plugin with the cover field it'd break. It could be re-added but I don't know if that's the right thing to do 🤔

@LekoArts
Copy link
Owner

Cool, thank you!
I‘ll have time to test it next week :)
Did you also test the modules? So that we could programatically create project pages with all the content (text + images)?

@S3B4S
Copy link
Contributor Author

S3B4S commented Feb 14, 2018

I'm sorry but I don't know which modules you're talking about? 🤔 I Wasn't aware of any, if you could point me in the right direction I'll look what I can do 😄

@LekoArts
Copy link
Owner

modules: project.modules
It contains both texts and images (basically the content of thr post)

@S3B4S
Copy link
Contributor Author

S3B4S commented Feb 14, 2018

Oh offcourse, thought you were talking about components in React or something, I will test it sometime this week, will get back with the results here.

@S3B4S
Copy link
Contributor Author

S3B4S commented Feb 17, 2018

So, after further testing it was indeed the case that the mapping of project.modules had to be adjusted, now it will check if the type is of images or grid_collection and only then it will map the number keys. In case of other types it will leave it untouched (I didn't spot any keys that were numbers in these cases).

@LekoArts LekoArts merged commit 2fd125d into LekoArts:master Feb 21, 2018
@LekoArts
Copy link
Owner

As you see I changed some things afterall :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants