diff --git a/app/lib/kafka.server.ts b/app/lib/kafka.server.ts index dcaa60ba0..eb85f2fa5 100644 --- a/app/lib/kafka.server.ts +++ b/app/lib/kafka.server.ts @@ -8,10 +8,10 @@ import { Kafka } from 'gcn-kafka' import memoizee from 'memoizee' -import { domain, getEnvOrDie } from './env.server' +import { domain, getEnvOrDieInProduction } from './env.server' -const client_id = getEnvOrDie('KAFKA_CLIENT_ID') -const client_secret = getEnvOrDie('KAFKA_CLIENT_SECRET') +const client_id = getEnvOrDieInProduction('KAFKA_CLIENT_ID') ?? '' +const client_secret = getEnvOrDieInProduction('KAFKA_CLIENT_SECRET') const kafka = new Kafka({ client_id, client_secret, diff --git a/app/routes/circulars.moderation.$circularId.$requestor.tsx b/app/routes/circulars.moderation.$circularId.$requestor.tsx index 88a779f47..f5bdf846c 100644 --- a/app/routes/circulars.moderation.$circularId.$requestor.tsx +++ b/app/routes/circulars.moderation.$circularId.$requestor.tsx @@ -8,7 +8,7 @@ import type { SEOHandle } from '@nasa-gcn/remix-seo' import type { ActionFunctionArgs, LoaderFunctionArgs } from '@remix-run/node' import { Form, redirect, useLoaderData } from '@remix-run/react' -import { Button, ButtonGroup } from '@trussworks/react-uswds' +import { Button, ButtonGroup, Checkbox } from '@trussworks/react-uswds' import { diffLines, diffWords } from 'diff' import { getUser } from './_auth/user.server' @@ -41,11 +41,18 @@ export async function action({ throw new Response(null, { status: 403 }) const data = await request.formData() const intent = getFormDataString(data, 'intent') + const redistribute = getFormDataString(data, 'redistribute') === 'on' + if (!intent || !circularId || !requestor) throw new Response(null, { status: 400 }) switch (intent) { case 'approve': - await approveChangeRequest(parseFloat(circularId), requestor, user) + await approveChangeRequest( + parseFloat(circularId), + requestor, + user, + redistribute + ) break case 'reject': await deleteChangeRequest(parseFloat(circularId), requestor, user) @@ -100,6 +107,13 @@ export default function () {