feat: add error message for lighthouse

This commit is contained in:
moonrailgun 2024-10-01 04:58:20 +08:00
parent 6c2a093842
commit bb0c574893
4 changed files with 5 additions and 0 deletions

View File

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "WebsiteLighthouseReport" ADD COLUMN "errorMessage" TEXT;

View File

@ -264,6 +264,7 @@ model WebsiteLighthouseReport {
accessibilityScore Int @default(0)
bestPracticesScore Int @default(0)
seoScore Int @default(0)
errorMessage String?
@@index([createdAt])
@@index([websiteId])

View File

@ -14,4 +14,5 @@ export const WebsiteLighthouseReportModelSchema = z.object({
accessibilityScore: z.number().int(),
bestPracticesScore: z.number().int(),
seoScore: z.number().int(),
errorMessage: z.string().nullish(),
})

View File

@ -649,6 +649,7 @@ export const websiteRouter = router({
},
data: {
status: WebsiteLighthouseReportStatus.Failed,
errorMessage: String(err),
},
});
});