Skip to content

Commit 699b310

Browse files
committed
feat: update post detail page
1 parent 77c6fbb commit 699b310

File tree

13 files changed

+17
-17
lines changed

13 files changed

+17
-17
lines changed

apps/web/@/actions/protect/postAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { revalidatePath } from "next/cache"
44
import { redirect } from "next/navigation"
55

6+
import { auth } from "configs/auth"
67
import prisma, {
78
createPost,
89
PostOnUserType,
@@ -16,7 +17,6 @@ import { toast } from "react-toastify"
1617

1718
import APP_ROUTES from "@/constants/routes"
1819
import { TUserItem, userSelect } from "@/types/users"
19-
import { auth } from "configs/auth"
2020

2121
// TODO: move to database package
2222
// Get total actions (like, bookmark) for a post

apps/web/@/molecules/nav/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import Link from "next/link"
22

3+
import { auth } from "configs/auth"
34
import { Edit } from "lucide-react"
45
import { getTranslations } from "next-intl/server"
56
import { buttonVariants, cn } from "ui"
67

7-
import { auth } from "configs/auth"
8-
98
import { UserNav } from "../user-nav"
109
import Logo from "./logo"
1110
import SearchBar from "./search-bar"

apps/web/@/molecules/posts/post-detail/edit-post-button/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react"
22
import Link from "next/link"
33

4+
import { auth } from "configs/auth"
45
import { PostStatus } from "database"
56
import { updatePostStatus } from "database/src/posts/queries"
67
import { LucideEdit } from "lucide-react"
@@ -10,7 +11,6 @@ import { Button, buttonVariants, cn, toast } from "ui"
1011
import { onTogglePost } from "@/actions/protect/postAction"
1112
import APP_ROUTES from "@/constants/routes"
1213
import { TPostItem } from "@/types/posts"
13-
import { auth } from "configs/auth"
1414

1515
import TogglePost from "./toggle-post"
1616

apps/web/app/[lang]/(protected)/user/posts/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React from "react"
22
import { Metadata } from "next/types"
33

4+
import { auth } from "configs/auth"
45
import { getPosts } from "database"
56

67
import NoItemFounded from "@/molecules/no-item-founded"
78
import PageTitle from "@/molecules/page-title"
89
import Filter from "@/molecules/user/posts/filter"
910
import PostItem from "@/molecules/user/posts/post-item"
10-
import { auth } from "configs/auth"
1111

1212
export async function generateMetadata(): Promise<Metadata> {
1313
return {

apps/web/app/[lang]/(protected)/user/profile/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { auth } from "configs/auth"
2+
13
import APP_APIS from "@/constants/apis"
24
import PageTitle from "@/molecules/page-title"
35
import Profile from "@/molecules/profile"
4-
import { auth } from "configs/auth"
56
import { generatePath } from "@/utils/generatePath"
67

78
export default async function Page() {

apps/web/app/[lang]/(protected-post)/user/posts/create/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { redirect } from "next/navigation"
22

3+
import { auth } from "configs/auth"
4+
35
import APP_ROUTES from "@/constants/routes"
46
import PostForm from "@/molecules/post-form"
5-
import { auth } from "configs/auth"
67

78
export const metadata = {
89
title: "Create Post",

apps/web/app/[lang]/(public-fullwidth)/posts/[postId]/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ import { TSearchParams } from "@/types"
1010

1111
import "./tocbot.css"
1212

13-
import { getPost, PostStatus } from "database"
14-
1513
import { auth } from "configs/auth"
14+
import { getPost, PostStatus } from "database"
1615

1716
export async function generateMetadata({ params }): Promise<Metadata> {
1817
const post = await getPost({ postIdOrSlug: params?.postId })

apps/web/app/api/protected/comment/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { NextRequest } from "next/server"
22

3+
import { auth } from "configs/auth"
34
import prisma from "database"
45
import { z } from "zod"
56

67
import { commentSelect } from "@/types/comment"
7-
import { auth } from "configs/auth"
88

99
export async function POST(request: NextRequest) {
1010
const session = await auth()

apps/web/app/api/protected/images/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import fs from "fs/promises"
22
import path from "path"
33
import { NextRequest } from "next/server"
44

5+
import { auth } from "configs/auth"
56
import { createImage, getImage, getImages, IImageFilter, ImageOrderBys, OrderBy } from "database"
67
import sharp from "sharp"
78
import { v4 as uuidv4 } from "uuid"
89

910
import { OrderByField } from "@/constants/upload"
10-
import { auth } from "configs/auth"
1111

1212
const OrderMap = {
1313
[OrderByField.nameAsc]: {

apps/web/app/api/protected/user/[userId]/follower/route.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { NextRequest } from "next/server"
22

3-
import prisma from "database"
4-
53
import { auth } from "configs/auth"
4+
import prisma from "database"
65

76
export async function GET(request: NextRequest, { params }: { params: { userId: string } }) {
87
const { userId } = params

0 commit comments

Comments
 (0)