diff --git a/src/lib/api/types.ts b/src/lib/api/types.ts index b753022..044eee1 100644 --- a/src/lib/api/types.ts +++ b/src/lib/api/types.ts @@ -1,7 +1,11 @@ -import type { SelectPartialStatus, SelectWebsitePartial } from '$lib/db/schema'; +import type { SelectMessage, SelectPartialStatus, SelectWebsitePartial } from '$lib/db/schema'; import type { StatusCode } from 'hono/utils/http-status'; -export type StatusPageResponse = SelectWebsitePartial & { statuses: SelectPartialStatus[] }; +export type StatusPageMessages = Pick; +export type StatusPageResponse = SelectWebsitePartial & { + statuses: SelectPartialStatus[]; + messages: StatusPageMessages[]; +}; export type ServiceResponse = { data?: T; diff --git a/src/lib/db/schema.ts b/src/lib/db/schema.ts index 3d96065..cd08517 100644 --- a/src/lib/db/schema.ts +++ b/src/lib/db/schema.ts @@ -201,10 +201,7 @@ export type SelectPartialStatus = Pick< SelectStatus, 'status' | 'responseTime' | 'statusCode' | 'createdAt' >; -export type SelectMessagePartial = Pick< - SelectMessage, - 'id' | 'title' | 'content' | 'startTime' | 'websiteId' ->; +export type SelectMessagePartial = Pick; // Zod Schemas export const InsertProjectSchema = createInsertSchema(projects); diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 84fe7b1..4622484 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -14,7 +14,8 @@ export const prettifyDate = (date: Date): string => { const dateFormatter = new Intl.DateTimeFormat('en-US', { day: '2-digit', - month: 'short' + month: 'short', + year: 'numeric' }); const time = timeFormatter.format(date);