init
This commit is contained in:
@@ -16,6 +16,28 @@ export type AiAnalysis = AiAnalysisInput & {
|
||||
createdAt: Date;
|
||||
};
|
||||
|
||||
export type SerializedAiAnalysis = {
|
||||
_id: string;
|
||||
targetType: AiAnalysisTargetType;
|
||||
targetId: string;
|
||||
summary: string;
|
||||
tips: string[];
|
||||
model: string;
|
||||
createdAt: string;
|
||||
};
|
||||
|
||||
export function serializeAnalysis(analysis: AiAnalysis): SerializedAiAnalysis {
|
||||
return {
|
||||
_id: analysis._id.toString(),
|
||||
targetType: analysis.targetType,
|
||||
targetId: analysis.targetId.toString(),
|
||||
summary: analysis.summary,
|
||||
tips: analysis.tips,
|
||||
model: analysis.model,
|
||||
createdAt: analysis.createdAt.toISOString(),
|
||||
};
|
||||
}
|
||||
|
||||
const COLLECTION = "ai_analyses";
|
||||
|
||||
async function getCollection() {
|
||||
|
||||
Reference in New Issue
Block a user