Skip to content

API issue resolved#51

Open
aviralmittal8 wants to merge 1 commit intoshradha-khapra:mainfrom
aviralmittal8:fix-spi-issue-42
Open

API issue resolved#51
aviralmittal8 wants to merge 1 commit intoshradha-khapra:mainfrom
aviralmittal8:fix-spi-issue-42

Conversation

@aviralmittal8
Copy link
Copy Markdown

fixed #42 #50 #43
Pull Request: Fix for Currency API Update Compatibility

📝 Summary:

This PR updates the currency converter application to align with the latest version of [Fawaz Ahmed’s Currency API](https://github.com/fawazahmed0/currency-api), which has recently transitioned its API endpoint format and structure.
These changes ensure the application continues to function correctly with the updated API path and data structure.


🔧 What’s Changed

🔄 Base URL Updated

  • Old URL:

    https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies
  • New URL:

    https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@{date}/v1/currencies
  • Introduced logic to dynamically fetch the latest date in YYYY-MM-DD format using JavaScript's Date() object and padStart() method.

🔁 Endpoint Structure Refactored

  • Old:
    /currencies/{from}/{to}.json

  • New:
    /currencies/{from}.json
    And then using:

    data[from][to]

@Jamshaid-aziz121
Copy link
Copy Markdown

got it

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API is not working

2 participants