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

feat: add zone to tribun news api #12

Merged
merged 2 commits into from
Oct 5, 2021

Conversation

axmad386
Copy link
Contributor

@axmad386 axmad386 commented Oct 4, 2021

This PR is to fix #10 and add zone params to api TribunNews
Currently, main rss API tribunnews is not support with params type, but it's work with subdomain api

api.tribunnews/:type => 404

:zone.tribunnews/:type => 200

In this PR, we add additional route for tribunnews, so we can access them with:

  • BASEURL/v1/tribun-news (get list news on main api)
  • BASEURL/v1/tribun-news/:zone (get list news on zone api)
  • BASEURL/v1/tribun-news/:zone/:type (get list news on zone api with type)

NOTE: some zone doesnt have some type, may be we can discuss later how to handle it

@vercel
Copy link

vercel bot commented Oct 4, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/satyawikananda/berita-api/Cu14QpK2jowWHzZCEXqkRmMBpy2v
✅ Preview: https://berita-api-git-fork-axmad386-main-satyawikananda.vercel.app

@satyawikananda
Copy link
Owner

Hi, thanks for your contribution, I have checked this and for some zone that doesn't has some types, I think we can add some response, for example:

{
  status: 404,
  message: "Type not found for this zone"
}

What do you think?

@satyawikananda satyawikananda changed the title feat: add zone to tribun news api feat: add zone to tribun news api (#10) Oct 4, 2021
@satyawikananda satyawikananda changed the title feat: add zone to tribun news api (#10) feat: add zone to tribun news api Oct 4, 2021
@satyawikananda satyawikananda added the enhancement New feature or request label Oct 4, 2021
@axmad386
Copy link
Contributor Author

axmad386 commented Oct 5, 2021

Hi, thanks for your contribution, I have checked this and for some zone that doesn't has some types, I think we can add some response, for example:

{
  status: 404,
  message: "Type not found for this zone"
}

What do you think?

Absolutely agree. I will add it soon

@axmad386
Copy link
Contributor Author

axmad386 commented Oct 5, 2021

Hi @satyawikananda, I found that every missing type will throw error message Status code 404 from rss parser. So I added the error response that we discussed earlier in catch block. It will ensure that error is not from server error. It is enough?

@satyawikananda
Copy link
Owner

Hi @satyawikananda, I found that every missing type will throw error message Status code 404 from rss parser. So I added the error response that we discussed earlier in catch block. It will ensure that error is not from server error. It is enough?

Yes, I think that's enough. Tell me if this PR is ready to merge :)

@axmad386
Copy link
Contributor Author

axmad386 commented Oct 5, 2021

Yeah thanks, this PR is ready for merge. I have another enhancement, but it's better to discuss later on different issue

@satyawikananda
Copy link
Owner

satyawikananda commented Oct 5, 2021

Yes, if you have another enhancement again, you can create an issue again. Anyway, thank you for your contributions here :)

I'll merge this.

@satyawikananda satyawikananda merged commit 3b97489 into satyawikananda:main Oct 5, 2021
@satyawikananda
Copy link
Owner

@all-contributors please add @axmad386 for code, bug and ideas

@allcontributors
Copy link
Contributor

@satyawikananda

I've put up a pull request to add @axmad386! 🎉

@axmad386
Copy link
Contributor Author

axmad386 commented Oct 7, 2021

@all-contributors please add @axmad386 for code, bug and ideas

Wow, I don't know what is this, but thank you 😄

@allcontributors
Copy link
Contributor

@axmad386

@axmad386 already contributed before to code, bug, ideas

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

Successfully merging this pull request may close these issues.

TribunNews API with type not exists
2 participants