mirror of
https://github.com/wassname/talk.git
synced 2026-07-05 19:06:55 +08:00
Add tenantDomain to StoryCreatedEventPayload (#2899)
* Add tenantID and siteID to StoryCreatedEventPayload * fix: added tenantID to payload * Remove tenantID from StoryCreatedCoralEvent * Add tenantDomain to webhook schema * fix: small comment fixes Co-authored-by: Wyatt Johnson <me@wyattjoh.ca>
This commit is contained in:
@@ -82,9 +82,21 @@ export function generateSignatures(
|
||||
.join(",");
|
||||
}
|
||||
|
||||
type CoralWebhookEventPayload = CoralEventPayload & {
|
||||
/**
|
||||
* tenantID is the ID of the Tenant that this event originated at.
|
||||
*/
|
||||
readonly tenantID: string;
|
||||
|
||||
/**
|
||||
* tenantDomain is the domain that is associated with this Tenant that this event originated at.
|
||||
*/
|
||||
readonly tenantDomain: string;
|
||||
};
|
||||
|
||||
export function generateFetchOptions(
|
||||
endpoint: Pick<Endpoint, "signingSecrets">,
|
||||
data: CoralEventPayload,
|
||||
data: CoralWebhookEventPayload,
|
||||
now: Date
|
||||
): FetchOptions {
|
||||
// Serialize the body and signature to include in the request.
|
||||
@@ -151,7 +163,11 @@ export function createJobProcessor({
|
||||
const now = new Date();
|
||||
|
||||
// Get the fetch options.
|
||||
const options = generateFetchOptions(endpoint, event, now);
|
||||
const options = generateFetchOptions(
|
||||
endpoint,
|
||||
{ ...event, tenantID, tenantDomain: tenant.domain },
|
||||
now
|
||||
);
|
||||
|
||||
// Send the request.
|
||||
const startedSendingAt = getNow();
|
||||
|
||||
Reference in New Issue
Block a user