Skip to content

Commit

Permalink
chore: update types
Browse files Browse the repository at this point in the history
  • Loading branch information
aritra1999 committed Dec 6, 2024
1 parent dc579e8 commit f8fc02d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 6 additions & 2 deletions src/lib/api/types.ts
Original file line number Diff line number Diff line change
@@ -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<SelectMessage, 'title' | 'content' | 'startTime'>;
export type StatusPageResponse = SelectWebsitePartial & {
statuses: SelectPartialStatus[];
messages: StatusPageMessages[];
};

export type ServiceResponse<T> = {
data?: T;
Expand Down
5 changes: 1 addition & 4 deletions src/lib/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<SelectMessage, 'id' | 'title' | 'content' | 'startTime'>;

// Zod Schemas
export const InsertProjectSchema = createInsertSchema(projects);
Expand Down
3 changes: 2 additions & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f8fc02d

Please sign in to comment.