mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
Refactor api requests and components out of pages
This commit is contained in:
@@ -32,7 +32,6 @@ const getAllBeerPosts = async (pageNum: number, pageSize: number) => {
|
||||
username: true,
|
||||
},
|
||||
},
|
||||
|
||||
beerComments: {
|
||||
select: {
|
||||
id: true,
|
||||
@@ -46,11 +45,11 @@ const getAllBeerPosts = async (pageNum: number, pageSize: number) => {
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
beerImages: {
|
||||
select: {
|
||||
url: true,
|
||||
id: true,
|
||||
alt: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -37,6 +37,7 @@ const getBeerPostById = async (id: string) => {
|
||||
},
|
||||
beerImages: {
|
||||
select: {
|
||||
alt: true,
|
||||
url: true,
|
||||
id: true,
|
||||
},
|
||||
|
||||
@@ -9,6 +9,7 @@ export default interface BeerPostQueryResult {
|
||||
beerImages: {
|
||||
url: string;
|
||||
id: string;
|
||||
alt: string;
|
||||
}[];
|
||||
|
||||
ibu: number;
|
||||
@@ -21,7 +22,6 @@ export default interface BeerPostQueryResult {
|
||||
id: string;
|
||||
username: string;
|
||||
};
|
||||
|
||||
beerComments: {
|
||||
id: string;
|
||||
content: string;
|
||||
|
||||
Reference in New Issue
Block a user