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 crypto from 'node:crypto';
|
||||||
import bcrypt from 'bcryptjs';
|
import bcrypt from 'bcryptjs';
|
||||||
import type { FastifyInstance, FastifyRequest } from 'fastify';
|
import type { FastifyInstance, FastifyRequest } from 'fastify';
|
||||||
|
import type { FilterMap } from '@bytelyst/datastore';
|
||||||
import { ForbiddenError, TooManyRequestsError, UnauthorizedError } from './errors.js';
|
import { ForbiddenError, TooManyRequestsError, UnauthorizedError } from './errors.js';
|
||||||
import { getCollection } from './datastore.js';
|
import { getCollection } from './datastore.js';
|
||||||
import * as rateLimitStore from '../modules/ratelimit/store.js';
|
import * as rateLimitStore from '../modules/ratelimit/store.js';
|
||||||
@ -339,7 +340,7 @@ export async function registerOptionalApiKeyContext(app: FastifyInstance): Promi
|
|||||||
if (!rawKey) return;
|
if (!rawKey) return;
|
||||||
|
|
||||||
const prefix = rawKey.slice(0, 12);
|
const prefix = rawKey.slice(0, 12);
|
||||||
const filter: Record<string, unknown> = {
|
const filter: FilterMap = {
|
||||||
prefix,
|
prefix,
|
||||||
status: 'active',
|
status: 'active',
|
||||||
expiresAt: { $gte: new Date().toISOString() },
|
expiresAt: { $gte: new Date().toISOString() },
|
||||||
|
|||||||
@ -21,14 +21,12 @@ export async function notifyReviewAssigned(
|
|||||||
await dispatchEmail(
|
await dispatchEmail(
|
||||||
{
|
{
|
||||||
to,
|
to,
|
||||||
subject: `Review assigned: ${review.title}`,
|
templateId: 'review-assigned',
|
||||||
html: [
|
variables: {
|
||||||
`<p>A review item has been assigned to you.</p>`,
|
title: review.title,
|
||||||
`<p><strong>${review.title}</strong></p>`,
|
description: review.description ?? '',
|
||||||
`<p>${review.description}</p>`,
|
runId: review.runId ?? '',
|
||||||
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}` : ''}`,
|
|
||||||
productId: review.productId,
|
productId: review.productId,
|
||||||
userId: review.assignedTo,
|
userId: review.assignedTo,
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user