Skip to content

Convert interface to type for handler Response types; add missing Response types#160

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-response-types-to-post-handlers
Draft

Convert interface to type for handler Response types; add missing Response types#160
Copilot wants to merge 2 commits intomainfrom
copilot/add-response-types-to-post-handlers

Conversation

Copy link
Contributor

Copilot AI commented Feb 26, 2026

All post handler Response types should be exported as type (not interface) for client-side TypeScript compatibility, following the pattern in doSearchWorkOrders.

Changes

  • shifts-post/doGetNoteTypesinterface DoGetNoteTypesResponseexport type DoGetNoteTypesResponse
  • workOrders-post/doGetNoteTypes — same conversion
  • workOrders-post/doGetWorkOrderAccomplishmentData — added missing export type DoGetWorkOrderAccomplishmentDataResponse union type and applied it to the Response<> parameter
  • Updated corresponding .d.ts files for all three

Pattern applied

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- Works on client side.
export type DoGetWorkOrderAccomplishmentDataResponse =
  | { success: true; data: WorkOrderAccomplishmentData }
  | { success: false; errorMessage: string }

export default async function handler(
  request: Request<unknown, unknown, RequestBody>,
  response: Response<DoGetWorkOrderAccomplishmentDataResponse>
): Promise<void>

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@cityssm-bot
Copy link
Member

cityssm-bot commented Feb 26, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@deepsource-io
Copy link

deepsource-io bot commented Feb 26, 2026

DeepSource Code Review

We reviewed changes in afa806a...3b070a4 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Feb 26, 2026 8:16p.m. Review ↗

Co-authored-by: dangowans <19495149+dangowans@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Response types for all post handlers Convert interface to type for handler Response types; add missing Response types Feb 26, 2026
Copilot AI requested a review from dangowans February 26, 2026 20:15
@sonarqubecloud
Copy link

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.

3 participants