Skip to content
Snippets Groups Projects
Commit 57cd1fae authored by DESKTOP-9FO96TP\hehexd's avatar DESKTOP-9FO96TP\hehexd
Browse files

fixed build error

parent 5fd4276b
No related branches found
No related tags found
1 merge request!23Tweet comments
Pipeline #36771 failed
......@@ -4,11 +4,8 @@ import PostCommentForm from "@/components/post-comment";
import PostItem from "@/components/post-item";
import { db } from "@/lib/db";
import { Prisma } from "@prisma/client";
/* export const revalidate = 5; */ // revalidate this page every 5 seconds
export const revalidate = 5; // revalidate this page every 5 seconds
type commentType = Prisma.CommentUncheckedCreateInput
type messageType = any // Prisma.PostUncheckedCreateInput
type messageItemProps = {
msg: messageType;
......@@ -17,7 +14,7 @@ type messageItemProps = {
export default async function PostDetail({ params }: { params: { postid: string } }) {
const postid = params.postid
let comments = null
let message: messageType | null = null
let message = null
try {
comments = await db.comment.findMany({
......@@ -68,14 +65,14 @@ export default async function PostDetail({ params }: { params: { postid: string
)
}
const CommentItem = ({ msg }: messageItemProps) => {
const CommentItem = ({ msg }: any) => {
if (!msg.id) {
return <div></div>;
}
return (
<div className="flex border-b border-gray-200 py-4">
<div className="flex-shrink-0">
<div className="h-10 w-10 rounded-full bg-gray-300"></div> {/* Profile picture */}
<div className="h-10 w-10 rounded-full bg-gray-300"></div>
</div>
<div className="ml-4 flex flex-col flex-grow">
<div>
......@@ -89,7 +86,7 @@ const CommentItem = ({ msg }: messageItemProps) => {
</div>
<div className="mt-4 flex">
<div className="bg-gray-200 rounded-lg py-10 px-20 mr-2">
{/* potential Image */}
</div>
</div>
<div className="flex justify-end" >
......
import CommentButton from "@/components/comment-button";
import LikeButton from "@/components/like-button";
import PostItem from "@/components/post-item";
import MessageItem from "@/components/post-item";
import PostMessageForm from "@/components/post-messages";
import { db } from "@/lib/db";
import { Prisma } from "@prisma/client";
/* export const revalidate = 5; */ // revalidate this page every 60 seconds
type messageType = any // Prisma.PostUncheckedCreateInput
type messageItemProps = {
......@@ -35,7 +31,7 @@ export default async function HomePage() {
<h1>Home WIP</h1>
<p>This will be where all Posts show up.</p>
<p>Needs a reload after posting!!</p>
<PostMessageForm data={messages} />
<PostMessageForm />
{messages ?
<>
{messages.map((msg) => (
......
......@@ -15,13 +15,12 @@ export async function POST(req: NextRequest) {
}
const userId = session.user.id
const data: comment = await req.json()
const data = await req.json()
console.log("router data: " + data.message, "status:")
try {
await db.comment.create({
/* data: data */
data: {
message: data.message,
postId: data.postId,
......
......@@ -7,9 +7,6 @@ import { Icons } from "./icons";
import { Button } from "./ui/button";
import Link from "next/link";
type commentType = Prisma.CommentUncheckedCreateInput
type postType = Prisma.PostSelect
export default function CommentButton(props: { data: any }) {
const postid = props.data.id
......
......@@ -6,14 +6,14 @@ type messageItemProps = {
msg: messageType;
};
export default function PostItem({ msg }: messageItemProps) {
export default function PostItem({ msg }: any) {
if (!msg.id) {
return <div></div>;
}
return (
<div className="flex border-b border-gray-200 py-4">
<div className="flex-shrink-0">
<div className="h-10 w-10 rounded-full bg-gray-300"></div> {/* Profile picture */}
<div className="h-10 w-10 rounded-full bg-gray-300"></div>
</div>
<div className="ml-4 flex flex-col flex-grow">
<div>
......@@ -27,7 +27,6 @@ export default function PostItem({ msg }: messageItemProps) {
</div>
<div className="mt-4 flex">
<div className="bg-gray-200 rounded-lg py-10 px-20 mr-2">
{/* potential Image */}
</div>
</div>
<div className="flex justify-end" >
......
......@@ -6,7 +6,7 @@ import { startTransition, useEffect, useState } from "react";
type messageType = Prisma.PostUncheckedCreateInput
export default function PostMessageForm(props: { data: Post[] | null }) {
export default function PostMessageForm() {
const [formData, setFormData] = useState<messageType>({ content: "" } as messageType);
const router = useRouter();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment