Files
outline/plugins/webhooks/server/presenters/webhookSubscription.ts
T
Tom Moor 321b232f17 Move "Webhook" settings to table (#12119)
* Move 'Webhook' settings to table

* Add tests
2026-04-19 19:27:32 -04:00

20 lines
553 B
TypeScript

import type { WebhookSubscription } from "@server/models";
import presentUser from "@server/presenters/user";
export default function presentWebhookSubscription(
webhook: WebhookSubscription
) {
return {
id: webhook.id,
name: webhook.name,
url: webhook.url,
secret: webhook.secret,
events: webhook.events,
enabled: webhook.enabled,
createdBy: webhook.createdBy ? presentUser(webhook.createdBy) : undefined,
createdById: webhook.createdById,
createdAt: webhook.createdAt,
updatedAt: webhook.updatedAt,
};
}