Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
896fbcd
fix: InfiniteList 수정
chaeyun-sim Dec 30, 2025
63f1cf4
fix: 날짜 값 변경 attendee -> date
chaeyun-sim Dec 30, 2025
bff6f86
feat: 마이페이지 포인트 관련 api 연결
chaeyun-sim Dec 30, 2025
50b1356
feat: 유저 관리 관련 api 연결
chaeyun-sim Dec 30, 2025
3fd4aea
feaet: 내 작성 글 목록 api 연결
chaeyun-sim Dec 30, 2025
f55361f
feat: 메인 페이지 티켓북 컴포넌트에 router 적용
chaeyun-sim Dec 30, 2025
3064168
feat: api instance에 token을 사용하지 않는 조건 추가
chaeyun-sim Dec 30, 2025
3824912
feat: 로그인 및 프로필 설정 시 api -> query로 변경
chaeyun-sim Dec 30, 2025
c3587f4
Merge branch 'dev' into feat/100
chaeyun-sim Jan 24, 2026
a0bbf9d
feat: 작성글 api 연결
chaeyun-sim Jan 24, 2026
1b95949
feat: 로그인 시 auth 데이터 sync
chaeyun-sim Jan 24, 2026
022ea49
feat: 마이페이지 프로필 설정에 회원가입 페이지 연결
chaeyun-sim Jan 24, 2026
86b8a2d
feat: 좋아요한 글 목록 api 연결
chaeyun-sim Jan 24, 2026
fb8d9cd
fix: 버그 수정
chaeyun-sim Jan 24, 2026
c60a817
fix: 로그인 수정
chaeyun-sim Jan 24, 2026
0e9ec16
fix: api unusedtoken 삭제
chaeyun-sim Jan 24, 2026
5dda429
fix: query, mutation fn 호출 방식 수정
chaeyun-sim Jan 24, 2026
3fb922d
feat: 로그인 유지 구현
chaeyun-sim Jan 24, 2026
a2f40a5
fix: 포인트 목록 구현
chaeyun-sim Jan 24, 2026
460bbde
fix: 티켓 상세 버그 수정
chaeyun-sim Jan 24, 2026
a7d9270
fix: useInfiniteList params 수정
chaeyun-sim Jan 24, 2026
df35230
fix: instance에 401 처리 추가
chaeyun-sim Jan 25, 2026
1edc59a
fix: ticket api tnwjd
chaeyun-sim Jan 25, 2026
069c2a8
fix: 후기글 추가 시 goBack 추가
chaeyun-sim Jan 25, 2026
819c546
Merge branch 'dev' into feat/100
chaeyun-sim Jan 25, 2026
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
13 changes: 13 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,18 @@ module.exports = (api) => {
['babel-preset-expo', { jsxImportSource: 'nativewind' }],
'nativewind/babel',
],
plugins: [
[
'module-resolver',
{
root: ['./'],
alias: {
// '@': './src',
// '@/assets': './assets',
api: './codegen/__generated__/api_sdk',
},
},
],
],
}
}
154 changes: 153 additions & 1 deletion package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"@svgr/plugin-svgo": "^8.1.0",
"@types/node": "^24.2.1",
"@types/react": "~19.0.10",
"babel-plugin-module-resolver": "^5.0.2",
"commander": "^14.0.0",
"eslint": "^9.0.0",
"eslint-config-expo": "~9.2.0",
Expand Down
16 changes: 12 additions & 4 deletions src/api.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
import { Api } from 'api'
import { getToken } from './lib/storage'
import { deleteToken, getToken } from './lib/storage'

function customFetch(
async function customFetch(
input: RequestInfo | URL,
init?: RequestInit,
): Promise<Response> {
return fetch(input, init)
const response = await fetch(input, init)

if (response.status === 401) {
await deleteToken('accessToken')
const { router } = await import('expo-router')
router.replace('/login')
}

return response
}

let instance: Api<unknown>['api'] | null = null

/**
* 토큰 로직 추가 필요
* API 인스턴스 반환
*/
export function api(): Api<unknown>['api'] {
if (instance) {
Expand Down
3 changes: 3 additions & 0 deletions src/apis/point/keys.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const pointKeys = {
all: ['point'] as const,
}
48 changes: 48 additions & 0 deletions src/apis/point/queries.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { infiniteQueryOptions, queryOptions } from '@tanstack/react-query'
import type { ApplicationResponse, GetMyPointHistoryParams } from 'api'
import { api } from '@/api'
import { pointKeys } from './keys'

type MyBalanceResponse = Omit<ApplicationResponse, 'data'> & {
data: {
current_balance: number
}
}

type MyPointHistoryResponse = Omit<ApplicationResponse, 'data'> & {
data: {
nextCursor: number
content: {
id: number
change_amount: number
balance_after: number
description: string
type: 'REVIEW_WRITE' | 'DAILY_LIKE'
createdAt: string
}
pageable: {
page_number: number
page_size: number
}
total_elements: number
total_pages: number
last: boolean
first: boolean
}
}

export const pointQueries = {
getMyBalance: () =>
queryOptions<MyBalanceResponse>({
queryKey: pointKeys.all,
queryFn: () => api().getMyBalance() as Promise<MyBalanceResponse>,
}),
getMyPointHistory: () =>
infiniteQueryOptions<MyPointHistoryResponse>({
queryKey: pointKeys.all,
queryFn: ({ pageParam = undefined }) =>
api().getMyPointHistory(pageParam as GetMyPointHistoryParams),
getNextPageParam: (lastPage) => lastPage?.data?.nextCursor,
initialPageParam: undefined as number | undefined,
}),
}
6 changes: 3 additions & 3 deletions src/apis/ticket/mutations.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { api } from '@/api'
import { useMutation, useQueryClient } from '@tanstack/react-query'
import type { TicketCreateReq, TicketUpdateReq } from 'api'
import { api } from '@/api'

import { ticketKeys } from './keys'

export const ticketMutations = {
createTicket: () => {
const queryClient = useQueryClient()

return useMutation({
mutationFn: ({ userId, ...data }: { userId: number } & TicketCreateReq) =>
api().createTicket({ userId }, data),
mutationFn: (data: TicketCreateReq) => api().createTicket(data),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ticketKeys.ticketList.all() })
},
Expand Down
8 changes: 7 additions & 1 deletion src/apis/ticket/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ export const ticketQueries = {
queryOptions({
queryKey: ticketKeys.ticketList.list(params),
queryFn: () => api().getTicketList(params),
enabled: !!params.userId,
}),
getTicketDetail: ({ ticketId }: { ticketId: number }) =>
queryOptions({
queryKey: ticketKeys.getTicketDetail({ ticketId }),
queryFn: () => api().getTicketDetail(ticketId),
enabled: !!ticketId,
select: (data) => data.data,
}),
getTicketDetail: ({ ticketId, userId }: GetTicketDetailParams) =>
queryOptions({
Expand Down
4 changes: 2 additions & 2 deletions src/apis/user/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export const userMutations = {
}),
deleteMyAccount: () =>
mutationOptions({
mutationFn: api().deleteMyAccount,
mutationFn: () => api().deleteMyAccount(),
}),
setupComplete: () =>
mutationOptions({
mutationFn: api().setupComplete,
mutationFn: () => api().setupComplete(),
}),
}
2 changes: 1 addition & 1 deletion src/apis/user/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export const userQueries = {
getMyInfo: () =>
queryOptions({
queryKey: userKeys.myInfo(),
queryFn: api().getMyInfo,
queryFn: () => api().getMyInfo(),
}),
}
6 changes: 4 additions & 2 deletions src/app/(auth)/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { useUser } from '@/providers/user.provider'
import { Redirect, Stack } from 'expo-router'
import { useAuth } from '@/providers/user.provider'

export default function AuthLayout() {
const user = useUser()
const { user, isLoading } = useAuth()

if (isLoading) return null

// exp가 고정된 값(1970년)으로 들어와서 우선 제거함
if (!user) return <Redirect href="/login" />
Expand Down
Loading