diff --git a/services/api/src/core/notifications/application/contracts/dtos/vapid.dto.ts b/services/api/src/core/notifications/application/contracts/dtos/vapid.dto.ts new file mode 100644 index 00000000..74b07d58 --- /dev/null +++ b/services/api/src/core/notifications/application/contracts/dtos/vapid.dto.ts @@ -0,0 +1,3 @@ +export class VapidDetails { + key!: string; +} diff --git a/services/api/src/core/notifications/client/controllers/notifications.controller.ts b/services/api/src/core/notifications/client/controllers/notifications.controller.ts index a0609780..3f4a4a0b 100644 --- a/services/api/src/core/notifications/client/controllers/notifications.controller.ts +++ b/services/api/src/core/notifications/client/controllers/notifications.controller.ts @@ -7,8 +7,12 @@ import { import { QueryBus } from "@nestjs/cqrs"; import { ApiTags } from "@nestjs/swagger"; +import { map } from "src/core/mapper"; +import { getRequiredStringConfig } from "src/utils/config.helper"; + import { NotificationMetaDetails } from "../../application/contracts/dtos/notification-meta.dto"; import { NotificationDetails } from "../../application/contracts/dtos/notification.dto"; +import { VapidDetails } from "../../application/contracts/dtos/vapid.dto"; import { GetNotificationListQuery } from "../../application/contracts/queries/get-notification-list.query"; @Controller("notifications") @@ -27,4 +31,11 @@ export class NotificationsController { async getMeta(): Promise { throw new NotImplementedException(); } + + @Get("vapid") + getVapid(): VapidDetails { + return map(VapidDetails, { + key: getRequiredStringConfig("VAPID_PUBLIC_KEY"), + }); + } }