Skip to content

Fix getSheet method to accept sheetId#162

Merged
ggoranov-smar merged 3 commits intomainlinefrom
bugfix/161-fix-getSheet-url
Mar 18, 2026
Merged

Fix getSheet method to accept sheetId#162
ggoranov-smar merged 3 commits intomainlinefrom
bugfix/161-fix-getSheet-url

Conversation

@ggoranov-smar
Copy link
Copy Markdown
Contributor

Fix getSheet URL and parameter (#161)

Problem

getSheet does not take sheetId as the parameter name and routes to the /sheets collection URL instead of /sheets/{sheetId}.

Changes

  • lib/sheets/get.js
    • Added a dedicated getSheet function that builds the URL as sheets/{sheetId} using the new buildUrl(sheetId) helper.
    • Refactored getSheetAsCSV, getSheetAsPDF, and getSheetAsExcel to directly call the requestor with sheetId-based URLs instead of delegating to listSheets.
    • Replaced _.extend(optionsToSend, ...) (mutating shared state) with spread syntax to prevent URL bleed-through between calls.
  • README.md — Updated example to use sheetId instead of id.
  • Tests — Updated endpoints.spec.ts and sheets.spec.ts to reflect the corrected parameter name and expected URLs.

@roomote-v0
Copy link
Copy Markdown

roomote-v0 bot commented Mar 18, 2026

Rooviewer Clock   See task

Review completed. The latest commit adds a properly formatted changelog entry with no issues found.

Summary:

  • ✅ Parameter name corrected from id to sheetId for consistency
  • ✅ URL routing fixed to use /sheets/{sheetId} instead of /sheets collection endpoint
  • ✅ State mutation issues resolved by using spread syntax
  • ✅ Export methods (CSV, PDF, Excel) now correctly build URLs with sheetId
  • ✅ Tests updated to match new parameter names and expected URLs
  • ✅ Lint errors fixed with proper line formatting
  • ✅ Changelog entry added following Keep a Changelog format

No issues found.

Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@ggoranov-smar ggoranov-smar merged commit 3db8b74 into mainline Mar 18, 2026
6 checks passed
@ggoranov-smar ggoranov-smar deleted the bugfix/161-fix-getSheet-url branch March 18, 2026 09:00
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.

2 participants