Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

배포용 PR #665

Merged
merged 5 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions src/apis/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ type GetFeedListResponse = {

type GetFeedByMemberIdResponse = Array<FeedBaseType>;

export type FeedVisibilityType = 'ALL' | 'FOLLOWER' | 'NONE';
export type FeedVisibilityType = 'ALL' | 'FOLLOWING' | 'NONE';

export const FEED_API = {
getFeed: async (memberId: number): Promise<GetFeedByMemberIdResponse> => {
const { data } = await apiInstance.get(`/feed/${memberId}`);
return data;
},
getFeedList: async (request: GetFeedListRequest): Promise<GetFeedListResponse> => {
const { data } = await apiInstance.get('/feed/me', {
const { data } = await apiInstance.get('/feed/me/v2', {
params: request,
});
return data;
Expand Down
93 changes: 48 additions & 45 deletions src/msw/handlers/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,59 @@ const BASE_URL = process.env.NEXT_PUBLIC_SEVER_API;
const getFeedResponse = {
success: true,
status: 200,
data: [
{
memberId: 5,
missionId: 7,
recordId: 6,
name: '미션4',
remark: '이 화면 작업중이에용',
nickname: '도모',
recordImageUrl: 'https://kr.object.ncloudstorage.com/10mm-images/dev/mission_record/20/image.png',
profileImage: null,
duration: 14,
sinceDay: 13,
startedAt: '2024-01-23 15:13:07',
finishedAt: '2024-01-22 15:34:36',
},
{
memberId: 5,
missionId: 8,
recordId: 27,
name: '미션5',
remark: '이 화면 작업중이에용',
recordImageUrl: 'https://kr.object.ncloudstorage.com/10mm-images/dev/mission_record/20/image.png',
data: {
content: [
{
memberId: 5,
missionId: 7,
recordId: 6,
name: '미션4',
remark: '이 화면 작업중이에용',
nickname: '도모',
recordImageUrl: 'https://kr.object.ncloudstorage.com/10mm-images/dev/mission_record/20/image.png',
profileImage: null,
duration: 14,
sinceDay: 13,
startedAt: '2024-01-23 15:13:07',
finishedAt: '2024-01-22 15:34:36',
},
{
memberId: 5,
missionId: 8,
recordId: 27,
name: '미션5',
remark: '이 화면 작업중이에용',
recordImageUrl: 'https://kr.object.ncloudstorage.com/10mm-images/dev/mission_record/20/image.png',

nickname: '도모',
profileImage: null,
duration: 14,
sinceDay: 13,
startedAt: '2024-01-23 15:13:07',
finishedAt: '2024-01-22 15:34:36',
},
{
memberId: 1,
missionId: 2,
recordId: 9,
name: '미션2',
remark: null,
nickname: '도모',
profileImage: null,
recordImageUrl: 'https://kr.object.ncloudstorage.com/10mm-images/dev/mission_record/20/image.png',
nickname: '도모',
profileImage: null,
duration: 14,
sinceDay: 13,
startedAt: '2024-01-23 15:13:07',
finishedAt: '2024-01-22 15:34:36',
},
{
memberId: 1,
missionId: 2,
recordId: 9,
name: '미션2',
remark: null,
nickname: '도모',
profileImage: null,
recordImageUrl: 'https://kr.object.ncloudstorage.com/10mm-images/dev/mission_record/20/image.png',

duration: 12,
sinceDay: 34,
startedAt: '2024-01-03 00:00:00',
finishedAt: '2024-01-03 00:12:30',
},
],
duration: 12,
sinceDay: 34,
startedAt: '2024-01-03 00:00:00',
finishedAt: '2024-01-03 00:12:30',
},
],
last: true,
},
timestamp: '2024-02-05T10:14:08.636259',
};

const getFeeds = http.get(BASE_URL + '/feed/me', () => {
const getFeeds = http.get(BASE_URL + '/feed/me/v2', () => {
return HttpResponse.json(getFeedResponse);
});

Expand Down
2 changes: 0 additions & 2 deletions src/pages/_app.page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Suspense } from 'react';
import type { AppProps } from 'next/app';
import ErrorPage from '@/components/ErrorPage';
import MonitoringInitializer from '@/components/MonitoringInitializer';
import NotificationSnackBarProvider from '@/components/NotificationSnackBar/NotificationSnackBarProvider';
import SnackBarProvider from '@/components/SnackBar/SnackBarProvider';
Expand All @@ -25,7 +24,6 @@ export default function App({ Component, pageProps }: AppProps) {
<TemplateComponent>
<div className={css(containerCss)}>
<Component {...pageProps} />
<ErrorPage />
</div>
</TemplateComponent>
</Suspense>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/feed/FeedSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ const FEED_TABS: { id: FeedVisibilityType; tabName: string }[] = [
tabName: '전체',
},
{
id: 'FOLLOWER',
id: 'FOLLOWING',
tabName: '팔로워',
},
];

function FeedSection() {
const tabProps = useTab(FEED_TABS, 'FOLLOWER');
const tabProps = useTab(FEED_TABS, 'FOLLOWING');

// const { data, isLoading } = useGetFeedList(tabProps.activeTab as FeedVisibilityType);
// const feeds = data?.filter((feed) => feed.recordImageUrl); // 이미지 없는 경우가 있음. 나중에 리팩토링 + 서버와 이야기, FeedItem에 ErrorBoundary 적용해도 좋을 듯.
Expand Down
Loading