fix blog not using updated db schema
This commit is contained in:
@@ -5,7 +5,7 @@ type BlogCardProps = {
|
||||
image: string,
|
||||
name: string,
|
||||
tagline: string,
|
||||
id: string
|
||||
id: number
|
||||
}
|
||||
export default function BlogCard(props: BlogCardProps) {
|
||||
return (
|
||||
|
||||
@@ -15,7 +15,7 @@ import { Trash } from 'grommet-icons';
|
||||
|
||||
export default function BlogPage() {
|
||||
const router = useRouter()
|
||||
const id = router.query.id as string
|
||||
const id = Number(router.query.id)
|
||||
const { status } = useSession()
|
||||
|
||||
// trpc stuff
|
||||
|
||||
@@ -8,7 +8,7 @@ type GenericItemType = {
|
||||
name: string,
|
||||
image: string,
|
||||
tagline: string,
|
||||
id: string
|
||||
id: number
|
||||
}
|
||||
|
||||
export default function Blog() {
|
||||
|
||||
@@ -28,7 +28,7 @@ export const blogRouter = createTRPCRouter({
|
||||
}),
|
||||
delete: protectedProcedure
|
||||
.input(
|
||||
z.string().min(1)
|
||||
z.number().min(1)
|
||||
)
|
||||
.mutation(async ({ctx, input}) => {
|
||||
return ctx.db.blogPost.delete({
|
||||
@@ -38,7 +38,9 @@ export const blogRouter = createTRPCRouter({
|
||||
})
|
||||
}),
|
||||
getOne: publicProcedure
|
||||
.input(String)
|
||||
.input(
|
||||
z.number()
|
||||
)
|
||||
.query(({ ctx, input }) => {
|
||||
return ctx.db.blogPost.findFirst({
|
||||
where: { id: input },
|
||||
|
||||
@@ -30,7 +30,7 @@ export const postRouter = createTRPCRouter({
|
||||
|
||||
delete: protectedProcedure
|
||||
.input(
|
||||
z.string().min(1)
|
||||
z.number().min(1)
|
||||
)
|
||||
.mutation(async ({ctx, input}) => {
|
||||
return ctx.db.post.delete({
|
||||
|
||||
Reference in New Issue
Block a user