scaffold create/edit beer form, scaffold beer page

This commit is contained in:
Aaron William Po
2023-01-23 20:13:25 -05:00
parent f08731de17
commit 972846f5a8
29 changed files with 776 additions and 70 deletions

View File

@@ -1,19 +1,17 @@
import DBClient from '@/prisma/DBClient';
import GetAllBreweryPostsQueryResult from './types/BreweryPostQueryResult';
import BreweryPostQueryResult from './types/BreweryPostQueryResult';
const prisma = DBClient.instance;
const getAllBreweryPosts = async () => {
const breweryPosts: GetAllBreweryPostsQueryResult[] = await prisma.breweryPost.findMany(
{
select: {
id: true,
location: true,
name: true,
postedBy: { select: { firstName: true, lastName: true, id: true } },
},
const breweryPosts: BreweryPostQueryResult[] = await prisma.breweryPost.findMany({
select: {
id: true,
location: true,
name: true,
postedBy: { select: { firstName: true, lastName: true, id: true } },
},
);
});
return breweryPosts;
};