Conversation
Co-authored-by: 239573049 <61819790+239573049@users.noreply.github.com>
… add warning log for missing WarehouseId Co-authored-by: 239573049 <61819790+239573049@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes the non-functional download documentation button in the repository UI by properly populating the repository state object with the warehouse ID from the API response.
- Extracts
WarehouseIdfrom the document catalog API response and builds a completeRepositoryInfoobject - Sets the
repositorystate in the store so thathandleDownloadcan accessrepository.idfor the export endpoint - Adds defensive logging when
WarehouseIdis missing to aid in debugging
| id: response.WarehouseId || '', | ||
| organizationName: owner, | ||
| name: name, | ||
| description: response.Description || '', |
There was a problem hiding this comment.
Field name inconsistency: The API response uses lowercase description (line 78 in DocumentCatalogService.cs) but the code accesses response.Description with uppercase 'D'. This will result in description always being an empty string. Use response.description instead to match the API response field name.
| description: response.Description || '', | |
| description: response.description || '', |
| description: response.Description || '', | ||
| address: response.git || '', | ||
| branch: targetBranch, | ||
| status: response.Status, |
There was a problem hiding this comment.
Field name inconsistency: The API response uses lowercase status (line 84 in DocumentCatalogService.cs from document?.Status), but accessing response.Status with uppercase 'S'. Use response.status to match the actual API response field name.
| status: response.Status, | |
| status: response.status, |
The download button in the repository documentation UI was non-functional because
repository.idwas always null whenhandleDownloadchecked it.Problem
The
fetchDocumentCatalogAPI returnsWarehouseIdin the response, but the store never populated therepositorystate object with this value. The download handler requiresrepository?.idto call the export endpoint.Changes
web-site/src/stores/repositoryDetail.store.ts: Build and setrepositoryobject from API response when fetching document catalogWarehouseIdis missing to aid debuggingOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.