Skip to content

Commit

Permalink
fix: add stats price fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
victorcg88 committed Nov 22, 2024
1 parent 82f5d94 commit ada56e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { PlatformStats } from '../../types/models/stats.model';
*/
export const statsSchema = createMutableSchema<PlatformStats, Stats>({
price: {
min: ({ price }) => Number(price.min),
max: ({ price }) => Number(price.max)
min: ({ price }) => (price?.min ? Number(price.min) : undefined),
max: ({ price }) => (price?.max ? Number(price.max) : undefined)
}
});
5 changes: 4 additions & 1 deletion packages/x-types/src/stats.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
* @public
*/
export interface Stats {
price: { min: number; max: number };
price: {
min: number | undefined;
max: number | undefined;
};
}

0 comments on commit ada56e7

Please sign in to comment.