Skip to content
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
1 change: 1 addition & 0 deletions src/apis/auth/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { newRequest } from '@apis/core';

import type { getUserInfoByJwtResponse } from './dto';

// jwt로 사용자 정보 조회 api /auth/me
Expand Down
1 change: 1 addition & 0 deletions src/apis/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import axios, {
AxiosResponse,
InternalAxiosRequestConfig,
} from 'axios';

import { NEW_JWT_KEY } from '../../config/constant';

// 기존 서버 응답 타입
Expand Down
1 change: 1 addition & 0 deletions src/apis/matching/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { newRequest } from '@apis/core';

import type {
CreateMatchingRequest,
CreateMatchingResponse,
Expand Down
6 changes: 4 additions & 2 deletions src/apis/post-comment/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { newRequest } from '../core';
import { CreateCommentRequest, CreateCommentResponse, GetCommentListResponse } from './dto';
import { EmptySuccessResponse } from '../core/dto';

import { CreateCommentRequest, CreateCommentResponse, GetCommentListResponse } from './dto';

import { newRequest } from '../core';

// 게시글 댓글 생성 API
export const createCommentApi = (postId: number, data: CreateCommentRequest) =>
newRequest.post<CreateCommentResponse>(`/post-comment?postId=${postId}`, data);
Expand Down
3 changes: 2 additions & 1 deletion src/apis/post-like/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { newRequest } from '../core';
import { TogglePostLikeStatusResponse, GetPostLikeListResponse } from './dto';

import { newRequest } from '../core';

// 게시글 좋아요 누르기/취소
export const togglePostLikeStatusApi = (postId: number) =>
newRequest.post<TogglePostLikeStatusResponse>(`/post-like/${postId}`);
Expand Down
23 changes: 11 additions & 12 deletions src/apis/post-report/dto.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
import { BaseSuccessResponse } from '../core/dto';

interface BaseReport {
id: number; // 신고 ID
userId: number; // 신고 생성 사용자 ID
postId: number; // 신고된 게시글 ID
content: string; // 신고된 게시글 내용
repostReason: string; // 신고 사유
id: number; // 신고 ID
userId: number; // 신고 생성 사용자 ID
postId: number; // 신고된 게시글 ID
content: string; // 신고된 게시글 내용
repostReason: string; // 신고 사유
}

// 게시글 신고 요청 DTO
export interface SendPostReportRequest {
requesterId: number; // 신고하는 사용자 ID
postId: number; // 신고 대상 게시글 ID
reason: string; // 신고 사유
requesterId: number; // 신고하는 사용자 ID
postId: number; // 신고 대상 게시글 ID
reason: string; // 신고 사유
}

// 게시물 신고 응답 데이터
export interface SendPostReportData extends BaseReport {
requesterId: number; // 신고하는 사용자 ID
postId: number; // 신고 대상 게시글 ID
reason: string; // 신고 사유
requesterId: number; // 신고하는 사용자 ID
postId: number; // 신고 대상 게시글 ID
reason: string; // 신고 사유
}

// 게시물 신고 응답 타입
export type SendPostReportResponse = BaseSuccessResponse<SendPostReportData>;

7 changes: 4 additions & 3 deletions src/apis/post-report/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { newRequest } from "../core";
import { SendPostReportRequest, SendPostReportResponse } from "./dto";
import { SendPostReportRequest, SendPostReportResponse } from './dto';

import { newRequest } from '../core';

// 게시글 신고 API
export const sendPostReportApi = (data: SendPostReportRequest) =>
newRequest.post<SendPostReportResponse>('/post-report', data);
newRequest.post<SendPostReportResponse>('/post-report', data);
6 changes: 4 additions & 2 deletions src/apis/post/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { newRequest } from '../core';
import { EmptySuccessResponse } from '../core/dto';

import {
CreatePostRequest,
CreatePostResponse,
Expand All @@ -8,7 +9,8 @@ import {
ModifyPostRequest,
ModifyPostResponse,
} from './dto';
import { EmptySuccessResponse } from '../core/dto';

import { newRequest } from '../core';

// 게시글 생성
export const createPostApi = (data: CreatePostRequest) => newRequest.post<CreatePostResponse>('/post', data);
Expand Down
2 changes: 2 additions & 0 deletions src/apis/user-block/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { newRequest } from '@apis/core';

import type { EmptySuccessResponse } from '@apis/core/dto';

import type { PostUserBlockRequest } from './dto';

// 유저 차단 api
Expand Down
2 changes: 2 additions & 0 deletions src/apis/user-report/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { newRequest } from '@apis/core';

import type { EmptySuccessResponse } from '@apis/core/dto';

import type { PostUserReportRequest } from './dto';

// 유저 신고 api
Expand Down
2 changes: 2 additions & 0 deletions src/apis/user/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { newRequest } from '@apis/core';

import type { EmptySuccessResponse } from '@apis/core/dto';

import type {
GetUserInfoResponse,
PatchUserInfoRequest,
Expand Down
1 change: 0 additions & 1 deletion src/components/Icons/Alarm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import type { IconsProps } from './dto';

const Alarm: React.FC<IconsProps> = ({ isFilled = false, width = '14', height = '18' }) => {
Expand Down
1 change: 0 additions & 1 deletion src/components/Icons/Heart.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import type { IconsProps } from './dto';

const Heart: React.FC<IconsProps> = ({ isFilled = false, width = '56', height = '56' }) => {
Expand Down
1 change: 0 additions & 1 deletion src/components/Icons/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import type { IconsProps } from './dto';

const Home: React.FC<IconsProps> = ({ color = '', isFilled = false, width = '14', height = '14' }) => {
Expand Down
1 change: 0 additions & 1 deletion src/components/Icons/Like.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import type { IconsProps } from './dto';

const Like: React.FC<IconsProps> = ({ isFilled = false, color = '', width = '16', height = '14' }) => {
Expand Down
1 change: 0 additions & 1 deletion src/components/Icons/Message.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import type { IconsProps } from './dto';

const Message: React.FC<IconsProps> = ({ color = '', isFilled = false, width = '14', height = '12' }) => {
Expand Down
1 change: 0 additions & 1 deletion src/components/Icons/MyPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import type { IconsProps } from './dto';

const MyPage: React.FC<IconsProps> = ({ color = '', isFilled = false, width = '16', height = '16' }) => {
Expand Down
1 change: 0 additions & 1 deletion src/components/Icons/Photo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import type { IconsProps } from './dto';

const Photo: React.FC<IconsProps> = ({ width = '18', height = '18', color = '#8E8E8E' }) => {
Expand Down
22 changes: 10 additions & 12 deletions vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
/// <reference types="vite/client" />

interface ImportMetaEnv {
VITE_REST_API_KEY: string;
VITE_REDIRECT_URI: string;
VITE_NAVER_CLIENT_ID: string;
VITE_NAVER_CLIENT_SECRET: string;
VITE_GOOGLE_CLIENT_ID: string;
VITE_GOOGLE_CLIENT_SECRET: string;
}

interface ImportMeta {
readonly env: ImportMetaEnv;
}
VITE_REST_API_KEY: string;
VITE_REDIRECT_URI: string;
VITE_NAVER_CLIENT_ID: string;
VITE_NAVER_CLIENT_SECRET: string;
VITE_GOOGLE_CLIENT_ID: string;
VITE_GOOGLE_CLIENT_SECRET: string;
}


interface ImportMeta {
readonly env: ImportMetaEnv;
}
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as path from 'path';

import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';

Expand Down
Loading
Loading