-
Notifications
You must be signed in to change notification settings - Fork 7
Develop #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #253
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { type ResourceIncidentViewResult } from '@/models/v4/incidentCommand/resourceIncidentViewResult'; | ||
|
|
||
| import { createApiEndpoint } from '../common/client'; | ||
|
|
||
| /** | ||
| * Fetches the resource-facing incident command view for a call. | ||
| * | ||
| * The route is RPC-style with the call id embedded in the path. The unit id is | ||
| * passed as a query parameter so the server can resolve the unit's lane | ||
| * assignment (MyAssignment). When no unit id is available the endpoint is | ||
| * called without it and the server resolves no assignment. | ||
| */ | ||
| export const getResourceIncidentView = async (callId: string | number, unitId?: string | number | null) => { | ||
| const getResourceIncidentViewApi = createApiEndpoint(`/IncidentCommand/GetResourceIncidentView/${encodeURIComponent(String(callId))}`); | ||
| const params = unitId !== undefined && unitId !== null && unitId !== '' ? { unitId } : undefined; | ||
| const response = await getResourceIncidentViewApi.get<ResourceIncidentViewResult>(params); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unhandled rejection in Kody rule violation: Handle async operations with proper error handling Prompt for LLMTalk to Kody by mentioning @kody Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing error handling around the network call — Rule 30 requires external/network calls to be wrapped in try/catch with context added and mapped to application-level errors. Wrap the GET in try/catch, log the operation name and identifiers ( Kody rule violation: Add try-catch blocks for external calls Prompt for LLMTalk to Kody by mentioning @kody Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction. |
||
| return response.data; | ||
| }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing JSDoc Promise and error annotations on
getResourceIncidentView— Rule 23 requires async functions to document the resolve value and rejection conditions. Add@returns {Promise<ResourceIncidentViewResult>}and@throws {Error} when the API request fails or the response is invalid.to the existing JSDoc block.Kody rule violation: Document async/Promise behavior and errors
Prompt for LLM
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.