Skip to content

Commit

Permalink
Create proper prisma type
Browse files Browse the repository at this point in the history
  • Loading branch information
ericbrian committed Sep 4, 2023
1 parent 7143b11 commit d7014e2
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 6 deletions.
9 changes: 8 additions & 1 deletion app/admin/country/view/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ import {
TableRow,
TableHead,
} from '@mui/material';
import { country as CountryType } from '@prisma/client';

import { Prisma } from '@prisma/client';
type CountryType = Prisma.countryGetPayload<{
include: {
country: true;
};
}>;

import moment from 'moment';
import React from 'react';

Expand Down
15 changes: 10 additions & 5 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,25 @@ import Box from '@mui/material/Box';
import Container from '@mui/material/Container';
import Typography from '@mui/material/Typography';

import appconfig from '@/appconfig';
import { coin as CoinType } from '@prisma/client';
import { Prisma } from '@prisma/client';
type CoinType = Prisma.coinGetPayload<{
include: {
image: true;
};
}>;

import { getCoins } from '@/http/coin';
import HomePageCoinDetail from './components/HomePageCoinDetail';
import { Card } from '@mui/material';

import appconfig from '@/appconfig';

export const metadata: Metadata = {
title: appconfig.siteName,
description: 'Welcome to Coin Organizer site.',
};

export default async function Home() {
const MAX_COINS: number = 5;
const coins: CoinType[] = await getCoins(MAX_COINS);
const coins: CoinType[] = await getCoins(appconfig.numberOfCoinsOnHomepage);

return (
<main>
Expand Down
1 change: 1 addition & 0 deletions appconfig.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const appconfig = {
siteName: "Eric's Coins",
siteDescription: "Eric's Coins Site.",
numberOfCoinsOnHomepage: 10,
links: {
github: "https://github.com/ericbrian/coinorganizer",
mastadon: "https://mstdn.social/@EricBrian",
Expand Down
92 changes: 92 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"react-instantsearch": "^7.0.1",
"react-query": "^3.39.3",
"typescript": "5.2.2"
},
"devDependencies": {
Expand Down

0 comments on commit d7014e2

Please sign in to comment.