Mobula_Url_Updated#504
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (2)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.env.example:
- Line 14: The environment variable MOBULA_API_KEY must be renamed to
VITE_MOBULA_API_KEY to follow Vite's VITE_ exposure convention; update the
.env.example entry to VITE_MOBULA_API_KEY="your_api_key_here" and then update
all code references that read MOBULA_API_KEY (e.g., any places accessing
import.meta.env.MOBULA_API_KEY or process.env.MOBULA_API_KEY) to use
VITE_MOBULA_API_KEY (import.meta.env.VITE_MOBULA_API_KEY) so the key is properly
exposed at build/runtime.
In `@src/apps/insights/utils/logoUtils.ts`:
- Around line 71-76: Fail fast if the MOBULA API key is missing and URL-encode
the search input: in src/apps/insights/utils/logoUtils.ts update the fetch logic
that constructs the URL using the variable symbol and sets Authorization from
import.meta.env.MOBULA_API_KEY so that you first throw or return an explicit
error when import.meta.env.MOBULA_API_KEY is empty/undefined (do not send a
placeholder), and use encodeURIComponent(symbol) when interpolating the symbol
into the request URL; ensure the Authorization header uses the real key value
only.
- Line 71: Replace the deprecated v1 URL template
`https://api.mobula.io/api/1/search?mode=og&sortBy=volume_24h&input=${symbol}`
with the v2 endpoint `https://api.mobula.io/api/2/fast-search` while keeping the
same query parameters (`input`, `mode`, `sortBy`) so the request becomes
`.../api/2/fast-search?mode=og&sortBy=volume_24h&input=${symbol}`; then update
the response parsing logic (where you currently expect v1 fields) to read the v2
response properties `symbol`, `logo`, and `marketCapUSD` (adjust any variable
names or object destructuring in the function that builds or consumes this URL
and the subsequent parsing code that uses the `symbol` variable) so the function
that constructs this template literal and the consumer of its response use the
new endpoint and fields.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 554aca5a-d736-485c-8b8f-25ccaa7632b9
📒 Files selected for processing (2)
.env.examplesrc/apps/insights/utils/logoUtils.ts
Deploying x with
|
| Latest commit: |
d16a42b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://54f187a5.x-e62.pages.dev |
| Branch Preview URL: | https://updated-mobula-endpoint.x-e62.pages.dev |
Deploying pillarx-debug with
|
| Latest commit: |
d16a42b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://97e198c4.pillarx-debug.pages.dev |
| Branch Preview URL: | https://updated-mobula-endpoint.pillarx-debug.pages.dev |
Description
-Added a new env called VITE_MOBULA_API_KEY for mobula api key and changed the mobula endpoint to current public endpoint
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Summary by CodeRabbit
Refactor
Chores