mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Feat: Implement mapbox for geocoding and location data for brewery posts
This commit is contained in:
@@ -14,7 +14,12 @@ const getAllBreweryPosts = async (pageNum?: number, pageSize?: number) => {
|
||||
take,
|
||||
select: {
|
||||
id: true,
|
||||
location: true,
|
||||
coordinates: true,
|
||||
address: true,
|
||||
city: true,
|
||||
stateOrProvince: true,
|
||||
country: true,
|
||||
description: true,
|
||||
name: true,
|
||||
postedBy: { select: { username: true, id: true } },
|
||||
breweryImages: { select: { path: true, caption: true, id: true, alt: true } },
|
||||
|
||||
@@ -9,7 +9,12 @@ const getBreweryPostById = async (id: string) => {
|
||||
await prisma.breweryPost.findFirst({
|
||||
select: {
|
||||
id: true,
|
||||
location: true,
|
||||
coordinates: true,
|
||||
address: true,
|
||||
city: true,
|
||||
stateOrProvince: true,
|
||||
country: true,
|
||||
description: true,
|
||||
name: true,
|
||||
breweryImages: { select: { path: true, caption: true, id: true, alt: true } },
|
||||
postedBy: { select: { username: true, id: true } },
|
||||
|
||||
@@ -2,8 +2,13 @@ import { z } from 'zod';
|
||||
|
||||
const BreweryPostQueryResult = z.object({
|
||||
id: z.string(),
|
||||
location: z.string(),
|
||||
name: z.string(),
|
||||
description: z.string(),
|
||||
address: z.string(),
|
||||
city: z.string(),
|
||||
stateOrProvince: z.string().or(z.null()),
|
||||
coordinates: z.array(z.number()),
|
||||
country: z.string().or(z.null()),
|
||||
postedBy: z.object({ id: z.string(), username: z.string() }),
|
||||
breweryImages: z.array(
|
||||
z.object({ path: z.string(), caption: z.string(), id: z.string(), alt: z.string() }),
|
||||
|
||||
Reference in New Issue
Block a user