Merged
Conversation
**Problem**: Dashboard widgets (Expiring Warranties, Licenses, Contracts) were displaying incomplete data due to column name mismatches between frontend and API. **Changes**: - Expiring Warranties API: Added `hostname as device_name` alias - Expiring Licenses API: Added JOIN with `software` table for `product_name as license_name` and `companies` table for vendor name - Expiring Contracts API: Added `contract_name as contract_title` alias and JOIN with `companies` table for vendor name **Testing**: Verified all three widgets load without errors and display proper empty states when no data exists. Build passing with 0 errors. **Files Modified**: - src/app/api/dashboard/expiring-warranties/route.ts - src/app/api/dashboard/expiring-licenses/route.ts - src/app/api/dashboard/expiring-contracts/route.ts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes dashboard widget APIs to return complete data with proper column names expected by the frontend. This resolves the "Dashboard Widget Fixes - 500 errors" item from the TODO list (though the issue was actually incomplete data, not 500 errors).
Problem
The three expiring items widgets on the dashboard were displaying incomplete/empty data because of column name mismatches between the frontend components and the API responses:
device_name, but API only returnedhostnamelicense_nameandvendor, but API didn't JOIN withsoftwareorcompaniestablescontract_titleandvendor, but API only returnedcontract_namewithout vendor JOINChanges
1. Expiring Warranties API (
src/app/api/dashboard/expiring-warranties/route.ts)d.hostname as device_namedevice_namefield2. Expiring Licenses API (
src/app/api/dashboard/expiring-licenses/route.ts)softwaretable:LEFT JOIN software s ON sl.software_id = s.idcompaniestable:LEFT JOIN companies c ON sl.purchased_from_id = c.ids.product_name as license_namec.company_name as vendor3. Expiring Contracts API (
src/app/api/dashboard/expiring-contracts/route.ts)companiestable:LEFT JOIN companies co ON c.company_id = co.idc.contract_name as contract_titleco.company_name as vendorTesting
Screenshots
Dashboard showing all three widgets with proper empty states:

Impact
Files Modified
src/app/api/dashboard/expiring-warranties/route.ts- Added column aliassrc/app/api/dashboard/expiring-licenses/route.ts- Added JOINs and aliasessrc/app/api/dashboard/expiring-contracts/route.ts- Added JOIN and aliasesVerification Steps
🤖 Generated with Claude Code