Skip to content

Commit

Permalink
Merge pull request #32 from biensupernice/chore/fix-date-types
Browse files Browse the repository at this point in the history
Adjust dates types
  • Loading branch information
jalvarado91 authored Mar 14, 2024
2 parents 4c272c6 + 1897a16 commit fd44a47
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/server/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ import { syncAllCollectives } from "@/pages/api/internal/sync-episodes";
export type DBTrack = {
source: "SOUNDCLOUD" | "MIXCLOUD";
duration: number;
// TODO: In Prod, mixcloud episodes have string dates
created_time: string | Date;
key: number;
created_time: Date;
key: number | string;
name: string;
url: string;
picture_large: string;
Expand All @@ -28,14 +27,8 @@ export function episodeProjection(t: WithId<DBTrack>) {
id: t._id.toString(),
source: t.source,
duration: t.duration,
releasedAt:
typeof t.created_time !== "string"
? t.created_time.toISOString()
: t.created_time,
createadAt:
typeof t.created_time !== "string"
? t.created_time.toISOString()
: t.created_time,
releasedAt: t.created_time.toISOString(),
createadAt: t.created_time.toISOString(),
embedPlayerKey: t.key,
name: t.name,
permalinkUrl: t.url,
Expand Down

1 comment on commit fd44a47

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for soulector ready!

✅ Preview
https://soulector-bkg4e4ay8-jalvarado91.vercel.app

Built with commit fd44a47.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.