From 1ad8660dd82d289789f03838c3a2a60e08c29655 Mon Sep 17 00:00:00 2001 From: saravanakumardb1 Date: Thu, 19 Mar 2026 19:02:57 -0700 Subject: [PATCH] fix(platform): fix 2 type errors found in typecheck sweep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - api-key-auth.ts: Record → FilterMap (import from @bytelyst/datastore) - reviews/notifications.ts: raw subject/html/text → templateId + variables (match dispatchEmail signature) --- services/platform-service/src/lib/api-key-auth.ts | 3 ++- .../src/modules/reviews/notifications.ts | 14 ++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/services/platform-service/src/lib/api-key-auth.ts b/services/platform-service/src/lib/api-key-auth.ts index 2fc04813..82871688 100644 --- a/services/platform-service/src/lib/api-key-auth.ts +++ b/services/platform-service/src/lib/api-key-auth.ts @@ -1,6 +1,7 @@ import crypto from 'node:crypto'; import bcrypt from 'bcryptjs'; import type { FastifyInstance, FastifyRequest } from 'fastify'; +import type { FilterMap } from '@bytelyst/datastore'; import { ForbiddenError, TooManyRequestsError, UnauthorizedError } from './errors.js'; import { getCollection } from './datastore.js'; import * as rateLimitStore from '../modules/ratelimit/store.js'; @@ -339,7 +340,7 @@ export async function registerOptionalApiKeyContext(app: FastifyInstance): Promi if (!rawKey) return; const prefix = rawKey.slice(0, 12); - const filter: Record = { + const filter: FilterMap = { prefix, status: 'active', expiresAt: { $gte: new Date().toISOString() }, diff --git a/services/platform-service/src/modules/reviews/notifications.ts b/services/platform-service/src/modules/reviews/notifications.ts index 58c3995b..605dde88 100644 --- a/services/platform-service/src/modules/reviews/notifications.ts +++ b/services/platform-service/src/modules/reviews/notifications.ts @@ -21,14 +21,12 @@ export async function notifyReviewAssigned( await dispatchEmail( { to, - subject: `Review assigned: ${review.title}`, - html: [ - `

A review item has been assigned to you.

`, - `

${review.title}

`, - `

${review.description}

`, - review.runId ? `

Run ID: ${review.runId}

` : '', - ].join(''), - text: `Review assigned: ${review.title}\n\n${review.description}${review.runId ? `\n\nRun ID: ${review.runId}` : ''}`, + templateId: 'review-assigned', + variables: { + title: review.title, + description: review.description ?? '', + runId: review.runId ?? '', + }, productId: review.productId, userId: review.assignedTo, },