Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
08f1c3e
chore: axios ์„ค์น˜
dudwns Mar 12, 2025
d17c68b
refactor: Query Key ์ƒ์ˆ˜๋กœ ๋ถ„๋ฆฌ
dudwns Mar 13, 2025
b7ec2f8
refactor: ๋งํฌ ๊ด€๋ จ fetch ํ•จ์ˆ˜๋ฅผ TanStack Query๋กœ ๋ฆฌํŒฉํ† ๋ง
dudwns Mar 13, 2025
170176c
refactor: ์ŠคํŽ˜์ด์Šค ๊ด€๋ จ fetch ํ•จ์ˆ˜๋ฅผ TanStack Query๋กœ ๋ฆฌํŒฉํ† ๋ง
dudwns Mar 14, 2025
4654237
refactor: ๋ฉค๋ฒ„ ๊ด€๋ จ fetch ํ•จ์ˆ˜๋ฅผ TanStack Query๋กœ ๋ฆฌํŒฉํ† ๋ง
dudwns Mar 14, 2025
5db4783
refactor: ๋Œ“๊ธ€ ๊ด€๋ จ fetch ํ•จ์ˆ˜๋ฅผ TanStack Query๋กœ ๋ฆฌํŒฉํ† ๋ง
dudwns Mar 14, 2025
1d95455
refactor: ์•Œ๋ฆผ ๊ด€๋ จ fetch ํ•จ์ˆ˜๋ฅผ TanStack Query๋กœ ๋ฆฌํŒฉํ† ๋ง
dudwns Mar 14, 2025
f8ec756
refactor: ์ด๋ฉ”์ผ ๊ด€๋ จ fetch ํ•จ์ˆ˜๋ฅผ TanStack Query๋กœ ๋ฆฌํŒฉํ† ๋ง
dudwns Mar 14, 2025
6584e5c
chore: ๊ฐœ๋นŒ ํ™˜๊ฒฝ์—์„œ pwa๊ฐ€ ์‹คํ–‰๋˜์ง€ ์•Š๋„๋ก ์„ค์ •
dudwns Mar 14, 2025
d18ed15
feat: ๋น„๊ณต๊ฐœ ์ŠคํŽ˜์ด์Šค๊ฐ€ ์ ‘์†๋˜์ง€ ์•Š๋Š” ๋ฌธ์ œ ์ˆ˜์ •
dudwns Mar 15, 2025
10f7e23
refactor: ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ fetch ํ•จ์ˆ˜๋ฅผ TanStack Query๋กœ ๋ฆฌํŒฉํ† ๋ง
dudwns Mar 15, 2025
6ceb235
feat: ํ”„๋กœํ•„ ์ˆ˜์ • ์‹œ ์‚ฌ์ด๋“œ๋ฐ” ํ”„๋กœํ•„ ์ •๋ณด๋„ ๋ณ€๊ฒฝ๋˜๋„๋ก ์ˆ˜์ •
dudwns Mar 15, 2025
2e6880b
refactor: auth ๊ด€๋ จ fetch ํ•จ์ˆ˜๋ฅผ TanStack Query๋กœ ๋ฆฌํŒฉํ† ๋ง
dudwns Mar 15, 2025
03ea27e
refactor: API ๋ผ์šฐํ„ฐ ๊ฒฝ๋กœ ๋ณ€๊ฒฝ
dudwns Mar 15, 2025
7c852c7
feat: API ์š”์ฒญ ๊ฒฝ๋กœ๋ฅผ Next.js API ๋ผ์šฐํŠธ๋กœ ๋ณ€๊ฒฝ
dudwns Mar 15, 2025
74d0b49
feat: ์˜ต์…”๋„ ์ฒด์ด๋‹ ์ถ”๊ฐ€
dudwns Mar 15, 2025
e67c78f
refactor: members ๋„ค์ด๋ฐ์„ users๋กœ ๋ณ€๊ฒฝ
dudwns Mar 15, 2025
1cce1c6
chore: ๋ถˆํ•„์š”ํ•œ ์ฝ”๋“œ ์‚ญ์ œ
dudwns Mar 15, 2025
3f10b35
refactor: meta ๋„ค์ด๋ฐ์„ metaData๋กœ ๋ณ€๊ฒฝ
dudwns Mar 15, 2025
582e765
feat: ์˜ต์…”๋„ ์ฒด์ด๋‹ ์ถ”๊ฐ€
dudwns Mar 15, 2025
40472a7
feat: ํ”„๋กœํ•„ ์ •๋ณด๋ฅผ ์„œ๋ฒ„ ํŒจ์น˜๋กœ ๋ณ€๊ฒฝ
dudwns Mar 15, 2025
e1992c7
chore: ๋ถˆํ•„์š”ํ•œ ์ฝ”๋“œ ์‚ญ์ œ
dudwns Mar 15, 2025
18cf43d
feat: ์„œ๋ฒ„ ํŒจ์น˜ ํ•จ์ˆ˜ ์ถ”๊ฐ€
dudwns Mar 15, 2025
b95239b
chore: API ๋ผ์šฐํ„ฐ ๊ฒฝ๋กœ ๋ณ€๊ฒฝ
dudwns Mar 15, 2025
3b278d4
refactor: FetchAPI์™€ FetchServerAPI ํด๋ž˜์Šค๋ฅผ ํ•จ์ˆ˜ํ˜•์œผ๋กœ ๋ณ€๊ฒฝ
dudwns Mar 15, 2025
ae803e9
refactor: API ํ˜ธ์ถœ ๋ฐฉ์‹์„ fetchAPI ์œ ํ‹ธ๋ฆฌํ‹ฐ ํ•จ์ˆ˜๋กœ ๋ณ€๊ฒฝ
dudwns Mar 17, 2025
45c2d00
feat: LinkListProps ํƒ€์ž… ์ˆ˜์ •
dudwns Mar 17, 2025
ecccfbc
refactor: ํ”„๋กœํ•„ ์„œ๋ฒ„ ํŒจ์น˜ ํ•จ์ˆ˜ ๋„ค์ด๋ฐ ๋ฐ ๊ฒฝ๋กœ ๋ณ€๊ฒฝ
dudwns Mar 17, 2025
f3e338f
feat: ํ”„๋กœํ•„ ์ˆ˜์ • mutation์„ ๋™๊ธฐ์ ์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๋„๋ก ๋ณ€๊ฒฝ
dudwns Mar 17, 2025
48255f1
chore: ๋ถˆํ•„์š”ํ•œ ํŒŒ์ผ ์‚ญ์ œ
dudwns Mar 17, 2025
f874f75
Merge pull request #336 from Team-TenTen/refactor/#335/fetch
dudwns Mar 17, 2025
c38cb9f
chore: axios ์ œ๊ฑฐ
dudwns Mar 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ const withPlugins = require('next-compose-plugins')

const withPWA = require('next-pwa')({
dest: 'public',
disable: process.env.NODE_ENV === 'development',
register: true,
skipWaiting: true,
})

const withBundleAnalyzer = require('@next/bundle-analyzer')({
Expand All @@ -15,7 +18,10 @@ const nextConfig = {
reactStrictMode: false,
images: {
minimumCacheTTL: 1 * 60 * 60 * 24 * 365,
domains: ['linkhub-s3-2025.s3.ap-northeast-2.amazonaws.com'],
domains: [
'linkhub-s3-2025.s3.ap-northeast-2.amazonaws.com',
'linkhub-s3.s3.ap-northeast-2.amazonaws.com',
],
formats: ['image/avif', 'image/webp'],
remotePatterns: [
{
Expand Down
136 changes: 109 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/app/(routes)/notification/invite/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import NotificationList from '@/components/common/NotificationList/NotificationList'
import { fetchGetInvitations } from '@/services/notification/invitations'
import { fetchGetInvitations } from '@/services/notification/useNotification'

const NotificationInvitePage = () => {
return (
Expand Down
6 changes: 3 additions & 3 deletions src/app/(routes)/space/[spaceId]/comment/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import CommentList from '@/components/CommentList/CommentList'
import Button from '@/components/common/Button/Button'
import DeferredComponent from '@/components/common/DeferedComponent/DeferedComponent'
import Space from '@/components/common/Space/Space'
import useGetSpace from '@/components/common/Space/hooks/useGetSpace'
import Tab from '@/components/common/Tab/Tab'
import TabItem from '@/components/common/Tab/TabItem'
import useTab from '@/components/common/Tab/hooks/useTab'
import { CATEGORIES_RENDER, MIN_TAB_NUMBER } from '@/constants'
import { useModal } from '@/hooks'
import { useCurrentUser } from '@/hooks/useCurrentUser'
import useSpaceComment from '@/hooks/useSpaceComment'
import { fetchGetComments } from '@/services/comment/comment'
import { fetchGetComments } from '@/services/comments/useComments'
import { useGetSpace } from '@/services/space/useSpace'
import { XMarkIcon } from '@heroicons/react/20/solid'
import dynamic from 'next/dynamic'

Expand All @@ -29,7 +29,7 @@ export interface CommentFormValues {

const SpaceCommentPage = ({ params }: { params: { spaceId: number } }) => {
const { isLoggedIn } = useCurrentUser()
const { space, isSpaceLoading } = useGetSpace()
const { data: space, isLoading: isSpaceLoading } = useGetSpace(params.spaceId)
const { register, unregister, setValue, setFocus, handleSubmit } =
useForm<CommentFormValues>({
defaultValues: {
Expand Down
6 changes: 4 additions & 2 deletions src/app/(routes)/space/[spaceId]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { fetchGetSpace } from '@/services/space/space'
import { Metadata } from 'next'

type SpaceLayoutProps = {
params: { spaceId: number }
}
const baseURL = process.env.NEXT_PUBLIC_API_ADDRESS

export async function generateMetadata({
params: { spaceId },
}: SpaceLayoutProps): Promise<Metadata> {
const space = await fetchGetSpace({ spaceId })
const space = await fetch(`${baseURL}/spaces/${spaceId}`, {
method: 'GET',
}).then((res) => res.json())

return {
title: space.spaceName,
Expand Down
13 changes: 6 additions & 7 deletions src/app/(routes)/space/[spaceId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import Button from '@/components/common/Button/Button'
import DeferredComponent from '@/components/common/DeferedComponent/DeferedComponent'
import useViewLink from '@/components/common/LinkList/hooks/useViewLink'
import Space from '@/components/common/Space/Space'
import useGetSpace from '@/components/common/Space/hooks/useGetSpace'
import useGetTags from '@/components/common/Space/hooks/useGetTags'
import Tab from '@/components/common/Tab/Tab'
import TabItem from '@/components/common/Tab/TabItem'
import useTab from '@/components/common/Tab/hooks/useTab'
Expand All @@ -15,7 +13,8 @@ import { CATEGORIES_RENDER, MIN_TAB_NUMBER } from '@/constants'
import { useSortParam } from '@/hooks'
import { useCurrentUser } from '@/hooks/useCurrentUser'
import useTagParam from '@/hooks/useTagParam'
import { fetchGetLinks } from '@/services/link/link'
import { fetchGetLinks } from '@/services/link/useLink'
import { useGetSpace, useGetTags } from '@/services/space/useSpace'
import { cls } from '@/utils'
import { PencilSquareIcon } from '@heroicons/react/24/outline'
import {
Expand All @@ -26,12 +25,12 @@ import {

const SpacePage = ({ params }: { params: { spaceId: number } }) => {
const { currentUser } = useCurrentUser()
const { space, isSpaceLoading } = useGetSpace()
const { data: space, isLoading: isSpaceLoading } = useGetSpace(params.spaceId)
const [isEdit, editToggle] = useToggle(false)
const [view, handleChangeList, handleChangeCard] = useViewLink()
const { currentTab, tabList } = useTab({ type: 'space', space })
const { sort, sortIndex, handleSortChange } = useSortParam('link')
const { tags, refetchTags, isTagsLoading } = useGetTags({
const { data: tags, isLoading: isTagsLoading } = useGetTags({
spaceId: space?.spaceId,
})
const { tag, tagIndex, handleTagChange } = useTagParam({ tags })
Expand Down Expand Up @@ -138,10 +137,10 @@ const SpacePage = ({ params }: { params: { spaceId: number } }) => {
isCanEdit={space.isCanEdit}
isMember={
!!space?.memberDetailInfos.find(
(member) => member.memberId === currentUser?.memberId,
(member: { memberId: number }) =>
member.memberId === currentUser?.memberId,
)
}
refetchTags={refetchTags}
/>
)}
<SpaceMemberList
Expand Down
10 changes: 5 additions & 5 deletions src/app/(routes)/space/[spaceId]/setting/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ import { Spinner } from '@/components'
import SpaceForm from '@/components/Space/SpaceForm'
import Button from '@/components/common/Button/Button'
import DeferredComponent from '@/components/common/DeferedComponent/DeferedComponent'
import useGetSpace from '@/components/common/Space/hooks/useGetSpace'
import { notify } from '@/components/common/Toast/Toast'
import { useModal } from '@/hooks'
import { fetchDeleteSpace } from '@/services/space/space'
import { useDeleteSpace, useGetSpace } from '@/services/space/useSpace'
import { useRouter } from 'next/navigation'

const SpaceSettingPage = ({ params }: { params: { spaceId: number } }) => {
const router = useRouter()
const spaceId = params.spaceId
const { space, isSpaceLoading } = useGetSpace()
const { data: space, isLoading: isSpaceLoading } = useGetSpace(spaceId)
const { Modal, isOpen, modalOpen, modalClose } = useModal(false)
const { mutate: deleteSpace } = useDeleteSpace()

const handleConfirm = async () => {
await fetchDeleteSpace(spaceId)
const handleConfirm = () => {
deleteSpace({ spaceId })
notify('info', '์ŠคํŽ˜์ด์Šค๊ฐ€ ์‚ญ์ œ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.')
router.replace('/')
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/(routes)/user/[userId]/favorite/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { useForm } from 'react-hook-form'
import { CategoryList, Input, SpaceList } from '@/components'
import { useCategoryParam, useProfileSpacesSearch } from '@/hooks'
import { fetchGetMyFavoriteSpaces } from '@/services/user/profile/favorites'
import { fetchGetMyFavoriteSpaces } from '@/services/space/useSpaces'
import { usePathname, useSearchParams } from 'next/navigation'
import { SearchFormValue } from '../space/page'

Expand Down
2 changes: 1 addition & 1 deletion src/app/(routes)/user/[userId]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ProfileTap } from '@/components'
import { fetchGetUserProfile } from '@/services/user/profile/profile'
import { fetchGetUserProfile } from '@/services/users/useUsers'
import { Metadata } from 'next'

export type UserLayoutProps = {
Expand Down
2 changes: 1 addition & 1 deletion src/app/(routes)/user/[userId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ProfileEditButton,
} from '@/components'
import { CATEGORIES_RENDER, PROFILE_MSG } from '@/constants'
import { fetchGetUserProfile } from '@/services/user/profile/profile'
import { fetchGetUserProfile } from '@/services/users/useUsers'
import { UserLayoutProps } from './layout'

export default async function UserPage({
Expand Down
Loading