Skip to content

Commit 0796d03

Browse files
committed
fix(fota): autoApply is boolean
1 parent 31b059a commit 0796d03

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/api/createFOTAJob.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Type, type Static } from '@sinclair/typebox'
22
import { JSONPayload, validatedFetch } from './validatedFetch.js'
33
import type { ValidationError } from 'ajv'
44

5-
const FOTAJobType = Type.Object(
5+
export const CreatedFOTAJobType = Type.Object(
66
{
77
jobId: Type.String({
88
minLength: 1,
@@ -35,7 +35,8 @@ export const createFOTAJob =
3535
deviceId: string
3636
bundleId: string
3737
}): Promise<
38-
{ error: Error | ValidationError } | { result: Static<typeof FOTAJobType> }
38+
| { error: Error | ValidationError }
39+
| { result: Static<typeof CreatedFOTAJobType> }
3940
> => {
4041
const maybeJob = await validatedFetch(
4142
{
@@ -48,11 +49,11 @@ export const createFOTAJob =
4849
resource: 'fota-jobs',
4950
payload: JSONPayload({
5051
bundleId,
51-
autoApply: 'true',
52+
autoApply: true,
5253
deviceIds: [deviceId],
5354
}),
5455
},
55-
FOTAJobType,
56+
CreatedFOTAJobType,
5657
)
5758

5859
if ('error' in maybeJob) return maybeJob

0 commit comments

Comments
 (0)