fix(platform): fix 2 type errors found in typecheck sweep
- api-key-auth.ts: Record<string, unknown> → FilterMap (import from @bytelyst/datastore) - reviews/notifications.ts: raw subject/html/text → templateId + variables (match dispatchEmail signature)
This commit is contained in:
parent
6a79742605
commit
1ad8660dd8
@ -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<string, unknown> = {
|
||||
const filter: FilterMap = {
|
||||
prefix,
|
||||
status: 'active',
|
||||
expiresAt: { $gte: new Date().toISOString() },
|
||||
|
||||
@ -21,14 +21,12 @@ export async function notifyReviewAssigned(
|
||||
await dispatchEmail(
|
||||
{
|
||||
to,
|
||||
subject: `Review assigned: ${review.title}`,
|
||||
html: [
|
||||
`<p>A review item has been assigned to you.</p>`,
|
||||
`<p><strong>${review.title}</strong></p>`,
|
||||
`<p>${review.description}</p>`,
|
||||
review.runId ? `<p>Run ID: ${review.runId}</p>` : '',
|
||||
].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,
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user