Skip to content

Commit

Permalink
JSON for Slack needs to be snake cased, not camel case
Browse files Browse the repository at this point in the history
  • Loading branch information
heavycrystal committed Jan 2, 2024
1 parent f857ef9 commit 6f2b271
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ui/app/alert-config/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const NewAlertConfig = () => {
const alertConfigReq: alertConfigType = {
serviceType: serviceType,
serviceConfig: {
authToken: authToken ?? '',
channelIds: channelIdString?.split(',')!,
auth_token: authToken ?? '',
channel_ids: channelIdString?.split(',')!,
},
};
const alertReqValidity = alertConfigReqSchema.safeParse(alertConfigReq);
Expand Down
4 changes: 2 additions & 2 deletions ui/app/alert-config/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ export const alertConfigReqSchema = z.object({
errorMap: (issue, ctx) => ({ message: 'Invalid service type' }),
}),
serviceConfig: z.object({
authToken: z
auth_token: z
.string({ required_error: 'Auth Token is needed.' })
.min(1, { message: 'Auth Token cannot be empty' })
.max(256, { message: 'Auth Token is too long' }),
channelIds: z
channel_ids: z
.array(z.string().min(1, { message: 'Channel IDs cannot be empty' }), {
required_error: 'We need a channel ID',
})
Expand Down

0 comments on commit 6f2b271

Please sign in to comment.