Repository navigation
Fix TypeScript build errors in ObjectQL API usage and chart types - #57
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Fix ObjectQL method calls in case.hook.ts: use ctx.db.doc.update() instead of ctx.db.update() - Fix ObjectQL method calls in case.hook.ts: use ctx.db.doc.create() instead of ctx.db.create() - Fix ObjectQL method calls in knowledge.hook.ts: use ctx.db.doc.update() instead of ctx.db.update() - Fix filter syntax in case.hook.ts: use 'Priority' instead of [['Priority', 'asc']] for sort parameter - Fix nullable reference errors in knowledge.hook.ts: add null checks for oldArticle and oldCase - Fix chart type in sales_intelligence.dashboard.ts: use 'table' instead of invalid 'list' type Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update details for action step in workflow
Fix TypeScript build errors in ObjectQL API usage and chart types
Jan 31, 2026
hotlong
marked this pull request as ready for review
January 31, 2026 14:48
There was a problem hiding this comment.
Pull request overview
This PR fixes TypeScript build errors caused by incorrect ObjectQL API usage, invalid sort parameter formats, missing null guards, and non-compliant chart types. The changes align with @objectstack/spec v0.7.2 protocol requirements and are purely type safety and API compliance fixes with no behavioral changes.
Changes:
- Updated ObjectQL API calls to use namespaced
ctx.db.doc.*methods instead of deprecated direct methods - Converted sort parameters from tuple array format to simple field names per ObjectQLFindOptions schema
- Added null safety guards for optional
ctx.oldcontext in hook handlers - Changed chart type from non-spec-compliant 'list' to 'table'
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/support/src/hooks/case.hook.ts | Fixed ObjectQL API namespace (7 db.doc.update calls, 1 db.doc.create call) and converted 3 sort parameters from tuple arrays to simple strings |
| packages/support/src/hooks/knowledge.hook.ts | Added null guards for ctx.old access and fixed 1 ObjectQL db.doc.update call |
| packages/ui/src/dashboard/sales_intelligence.dashboard.ts | Changed 2 widget types from 'list' to 'table' for spec compliance |
This branch was successfully deployed
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.
Description
CI build failed with TypeScript errors in support and UI packages. Root causes: incorrect ObjectQL API namespace usage (pre-migration patterns), invalid sort parameter format, missing null guards on optional hook context, and non-spec-compliant chart types.
Type of Change
Related Issues
CI Failure: https://github.com/objectstack-ai/hotcrm/actions/runs/21545139473/job/62085377886#step:7:1
Changes Made
ObjectQL API Namespace Corrections (10 occurrences)
Sort Parameter Type Alignment (3 occurrences)
Null Safety for Hook Context (2 occurrences)
Chart Type Spec Compliance (2 occurrences)
Testing
npm test)npm run lint)npm run build)Screenshots
N/A - Build fix only
Checklist
Additional Notes
All changes align with @objectstack/spec v0.7.2 protocol requirements. No behavioral changes - purely type safety and API compliance fixes.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.