Skip to content

Commit

Permalink
add S3 destination
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed Dec 11, 2024
1 parent 79b90d9 commit 52f1f33
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ const createPaymentSendEvents = async (
combinedResponse["uniform"] = uniformEvent;
}

if (destinations.includes("s3")) {
const s3Event = await createScheduledEvent({
webhook: `{{HASURA_PLANX_API_URL}}/upload-submission/${teamSlug}`,
schedule_at: now,
payload: eventPayload,
comment: `upload_submission_${payload.sessionId}`,
});
combinedResponse["s3"] = s3Event;
}

return res.json(combinedResponse);
} catch (error) {
return next({
Expand Down
1 change: 1 addition & 0 deletions api.planx.uk/modules/send/createSendEvents/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createScheduledEvent } from "../../../lib/hasura/metadata/index.js";
import type { CreateSendEventsController } from "./types.js";

// Create "One-off Scheduled Events" in Hasura from Send component for selected destinations
// REMINDER to keep these destinations in sync with api.planx.uk/modules/pay/service/inviteToPay/createPaymentSendEvents.ts
const createSendEvents: CreateSendEventsController = async (
_req,
res,
Expand Down

0 comments on commit 52f1f33

Please sign in to comment.