mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: clean up eslint-disable lines (#4735)
* chore: drop eslint-disable rule * refactor: add types for makeMockApiError
This commit is contained in:
@@ -99,7 +99,6 @@ export interface WorkspaceScheduleFormValues {
|
||||
ttl: number
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
export const validationSchema = Yup.object({
|
||||
sunday: Yup.boolean(),
|
||||
monday: Yup.boolean().test(
|
||||
|
||||
@@ -814,15 +814,29 @@ export const MockCancellationMessage = {
|
||||
message: "Job successfully canceled",
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
export const makeMockApiError = ({
|
||||
message,
|
||||
detail,
|
||||
validations,
|
||||
}: {
|
||||
type MockAPIInput = {
|
||||
message?: string
|
||||
detail?: string
|
||||
validations?: FieldError[]
|
||||
}
|
||||
|
||||
type MockAPIOutput = {
|
||||
response: {
|
||||
data: {
|
||||
message: string
|
||||
detail: string | undefined
|
||||
validations: FieldError[] | undefined
|
||||
}
|
||||
}
|
||||
isAxiosError: boolean
|
||||
}
|
||||
|
||||
type MakeMockApiErrorFunction = (input: MockAPIInput) => MockAPIOutput
|
||||
|
||||
export const makeMockApiError: MakeMockApiErrorFunction = ({
|
||||
message,
|
||||
detail,
|
||||
validations,
|
||||
}) => ({
|
||||
response: {
|
||||
data: {
|
||||
|
||||
Reference in New Issue
Block a user