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

Develop #42

Merged
merged 148 commits into from
Aug 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
9883a4b
Feat : [#2] SideNav 구현
narinn-star May 19, 2023
f99bdfa
Feat : [#2] Nested route _ Outlet
narinn-star May 20, 2023
a316a86
Feat : [#2] SideNav 하위 페이지
narinn-star May 21, 2023
738d891
Design : [#2] SideNav UI 수정
narinn-star May 21, 2023
e1a59b4
Design : [#2] SideNav UX
narinn-star May 21, 2023
3fc92b0
Merge pull request #3 from inje-megabrain/SideNav
narinn-star May 22, 2023
f142af3
Feat : [#1] Token
narinn-star May 22, 2023
bbb2265
Feat : [#1] GitHub OAuth 연동
narinn-star May 23, 2023
f1eba3c
Merge pull request #4 from inje-megabrain/OAuth
narinn-star May 23, 2023
c93c183
Design : DaisyUI
narinn-star May 24, 2023
edca6ad
Merge pull request #5 from inje-megabrain/OAuth
narinn-star May 24, 2023
7faee9b
Feat : [#6] MainPage Layout
narinn-star May 24, 2023
f6b5d95
Feat : [#6] MainScroll
narinn-star May 26, 2023
52b07f9
Design : [#6] Main position
narinn-star May 26, 2023
c2163a3
Feat : [#6] Main NavLink
narinn-star May 26, 2023
f46e911
Merge pull request #7 from inje-megabrain/MainLayout
narinn-star May 26, 2023
abf5597
Fix : eslint error
narinn-star May 26, 2023
200874e
Merge pull request #8 from inje-megabrain/MainLayout
narinn-star May 26, 2023
6db15fa
Feat : [#9] Infinite Scroll Base
narinn-star May 27, 2023
b9a359c
Merge pull request #10 from inje-megabrain/InfiniteScroll
narinn-star May 27, 2023
a6d19ac
Feat : [#11] setAuth
narinn-star May 27, 2023
368205f
Feat : [#11] MyPage Details
narinn-star May 27, 2023
dc01cb8
Feat : [#11] Profile fetch Success
narinn-star May 30, 2023
0d5b67d
Feat : (#11) Automatically Logout
narinn-star Jun 4, 2023
fa0ac72
Feat : [#11] Profile fetchUser Modified
narinn-star Jun 6, 2023
541490f
Feat : [#11] AccessToken
narinn-star Jun 6, 2023
763e01a
Design : [#11] Profile
narinn-star Jun 7, 2023
8bc42ea
Merge pull request #12 from inje-megabrain/MyPage
narinn-star Jun 7, 2023
5851973
Chore : Webpack Error
narinn-star Jun 7, 2023
4afe33c
Design : [#11] Profile Design
narinn-star Jun 7, 2023
6d630bb
Merge pull request #13 from inje-megabrain/MyPage
narinn-star Jun 7, 2023
b2871aa
Feat : [#14] WritePage
narinn-star Jun 7, 2023
02ce7bb
Fix : headerConfig 제거
narinn-star Jun 8, 2023
c4300bd
Design : [#14] WritePage Design Modified
narinn-star Jun 9, 2023
9f68a54
Merge pull request #15 from inje-megabrain/Write
narinn-star Jun 9, 2023
65c9a7a
Design : [#16] Post List Design Modified
narinn-star Jun 9, 2023
4a4b6bd
Merge pull request #17 from inje-megabrain/PostList
narinn-star Jun 10, 2023
ec3f3a7
Feat : [#14] get Readme
narinn-star Jun 10, 2023
3cfcf14
Feat : [#14] ReadmeFile Viewer
narinn-star Jun 10, 2023
7736b18
Chore : accessAtom deleted
narinn-star Jun 12, 2023
5a7a681
Feat : [#14] Component to Image
narinn-star Jun 12, 2023
d5ad738
Merge pull request #18 from inje-megabrain/Write
narinn-star Jun 12, 2023
9f6d962
Feat : [#16] getAllPost
narinn-star Jun 12, 2023
ca897e0
Design : [#11] Profile UI modified
narinn-star Jun 13, 2023
4aff99c
Design : [#11] SideNav UI modified
narinn-star Jun 13, 2023
8dc8a0b
Merge pull request #19 from inje-megabrain/PostList
narinn-star Jun 14, 2023
48eade2
Merge pull request #20 from inje-megabrain/MyPage
narinn-star Jun 14, 2023
286167d
Design : [#11] MyPage UI Modified
narinn-star Jun 14, 2023
d31f798
Merge pull request #21 from inje-megabrain/MyPage
narinn-star Jun 14, 2023
e5ae578
Feat : [#14] html2Canvas
narinn-star Jun 14, 2023
dc1b965
Chore : [#11] html2canvas library
narinn-star Jun 14, 2023
43173dd
Merge pull request #22 from inje-megabrain/Write
narinn-star Jun 14, 2023
1d40c8d
Fix : localStorage getItem 관련 오류
narinn-star Jun 16, 2023
4b378aa
Merge pull request #23 from inje-megabrain/Write
narinn-star Jun 16, 2023
8797cbb
Feat : Login
narinn-star Jun 19, 2023
b7f9d1d
Merge pull request #24 from inje-megabrain/Login
narinn-star Jun 19, 2023
cec23ff
Feat : [#14] html2canvas error
narinn-star Jun 19, 2023
9f5e576
Feat : [#14] file-saver
narinn-star Jun 19, 2023
418028b
Chore : [#16] cleanup
narinn-star Jun 20, 2023
3cd73f3
Feat : [#14] ContentsLength event
narinn-star Jun 22, 2023
65829ec
Feat : [#14] svg file 전송
narinn-star Jun 22, 2023
e3a66c2
Feat : [#14] Thumbnail base 제작 완료
narinn-star Jun 24, 2023
267cba9
Merge pull request #25 from inje-megabrain/Write
narinn-star Jun 24, 2023
6a795e1
Chore : [#11] MyPage _ Profile contents error
narinn-star Jun 24, 2023
1fb2fd9
Design : [#11] Delete Page UI
narinn-star Jun 26, 2023
3f91aa0
Create main.yml
narinn-star Jul 6, 2023
90151a7
Merge pull request #26 from inje-megabrain/CI
narinn-star Jul 6, 2023
acc7a52
Feat : [#11] FetchMyPost
narinn-star Jul 6, 2023
b042f16
Merge pull request #27 from inje-megabrain/MyPage
narinn-star Jul 6, 2023
7786d4c
Update main.yml
narinn-star Jul 6, 2023
a80b79d
Update main.yml
narinn-star Jul 6, 2023
cb3e1b5
Update main.yml
narinn-star Jul 6, 2023
b46cbe2
Update main.yml
narinn-star Jul 6, 2023
cc899e9
Update main.yml
narinn-star Jul 6, 2023
79c6519
Update main.yml
narinn-star Jul 6, 2023
3757f67
Update main.yml
narinn-star Jul 6, 2023
e0095de
Update main.yml
narinn-star Jul 6, 2023
2ddb8a9
Update main.yml
narinn-star Jul 6, 2023
774be79
Fix : output path modified
narinn-star Jul 6, 2023
d71c59f
Merge pull request #28 from inje-megabrain/MyPage
narinn-star Jul 6, 2023
915aacb
Fix : appspec.yml destination added
narinn-star Jul 6, 2023
d6a861b
Merge pull request #29 from inje-megabrain/MyPage
narinn-star Jul 6, 2023
c84db65
Update main.yml
narinn-star Jul 6, 2023
fabd2bd
Update main.yml
narinn-star Jul 6, 2023
b664ba7
Update main.yml
narinn-star Jul 6, 2023
44548af
Update main.yml
narinn-star Jul 9, 2023
235ecf4
Update main.yml
narinn-star Jul 9, 2023
2dc1d41
Update main.yml
narinn-star Jul 9, 2023
489895c
Update main.yml
narinn-star Jul 9, 2023
49509c8
Update main.yml
narinn-star Jul 9, 2023
a66a226
Update main.yml
narinn-star Jul 9, 2023
0f5acc2
deploy.sh added
narinn-star Jul 9, 2023
b4398e2
Merge pull request #30 from inje-megabrain/MyPage
narinn-star Jul 9, 2023
5b32123
Update main.yml
narinn-star Jul 9, 2023
593165e
Update main.yml
narinn-star Jul 9, 2023
bd9f8f8
Update main.yml
narinn-star Jul 9, 2023
ab7c19e
Update deploy.sh
sleeg00 Jul 10, 2023
ded9afb
Update appspec.yml
sleeg00 Jul 10, 2023
59ef06f
Update main.yml
sleeg00 Jul 10, 2023
53e9850
Update main.yml
sleeg00 Jul 10, 2023
aeaf249
Update appspec.yml
sleeg00 Jul 10, 2023
c043c79
Update deploy.sh
sleeg00 Jul 10, 2023
3e6c2da
Update appspec.yml
sleeg00 Jul 10, 2023
890d92e
Update deploy.sh
sleeg00 Jul 10, 2023
0f61d2e
Update appspec.yml
sleeg00 Jul 10, 2023
394c420
Update appspec.yml
sleeg00 Jul 10, 2023
394e51b
useInfinite, package.json modified
narinn-star Jul 17, 2023
76e9f12
Merge pull request #31 from inje-megabrain/MyPage
narinn-star Jul 17, 2023
134879c
router basename
narinn-star Jul 17, 2023
b23127a
Merge pull request #32 from inje-megabrain/MyPage
narinn-star Jul 17, 2023
0bf07f8
router basename
narinn-star Jul 17, 2023
2f71540
Merge pull request #33 from inje-megabrain/MyPage
narinn-star Jul 17, 2023
86f3579
Update main.yml
narinn-star Jul 17, 2023
ab69816
Update main.yml
narinn-star Jul 17, 2023
c4a0df4
Update deploy.sh
narinn-star Jul 18, 2023
f0fa601
Infinity Scroll 작업중
narinn-star Jul 20, 2023
3d04ffd
Merge branch 'develop' into MyPage
narinn-star Jul 20, 2023
757ec93
Merge pull request #34 from inje-megabrain/MyPage
narinn-star Jul 20, 2023
f571f54
Feat : [#9] Infinity Scroll
narinn-star Jul 20, 2023
0f5b890
Merge pull request #35 from inje-megabrain/InfiniteScroll
narinn-star Jul 20, 2023
e7dfce0
Update deploy.sh
narinn-star Jul 23, 2023
43abd18
Update main.yml
narinn-star Jul 23, 2023
d602335
Update deploy.sh
narinn-star Jul 25, 2023
ba63304
Update constants.ts
narinn-star Jul 25, 2023
22cf3e1
Update package.json
narinn-star Jul 29, 2023
481e62e
Update constants.ts
narinn-star Jul 29, 2023
d04cd72
Delete package-lock.json
narinn-star Jul 29, 2023
c0becaf
Update deploy.sh
narinn-star Jul 29, 2023
39085a0
Update index.html
narinn-star Jul 29, 2023
f9ec57a
Merge branch 'develop' into narinn-star-patch-1
narinn-star Jul 29, 2023
42616d7
Merge pull request #36 from inje-megabrain/narinn-star-patch-1
narinn-star Jul 29, 2023
b065839
Update index.html
narinn-star Jul 29, 2023
0d2d42e
Update index.html
narinn-star Jul 29, 2023
cf61842
Feat : [#11] mypost api
narinn-star Aug 8, 2023
8beb653
Feat : [#11] MyPage_Mypost
narinn-star Aug 21, 2023
a0c807e
Merge pull request #37 from inje-megabrain/MyPost
narinn-star Aug 22, 2023
7cddfc5
Feat : [#16] PostById details API
narinn-star Aug 22, 2023
23dd656
Feat : [#16] PostModal, Readme added
narinn-star Aug 23, 2023
3ba5846
Feat : get Image ing..
narinn-star Aug 24, 2023
8c3e884
Merge pull request #38 from inje-megabrain/PostList
narinn-star Aug 24, 2023
b458d05
Feat [#11] MyPost_Delete
narinn-star Aug 25, 2023
4eae759
Merge pull request #39 from inje-megabrain/MyPost
narinn-star Aug 25, 2023
7035aa7
Feat [#16] Like, Modal UI modified
narinn-star Aug 25, 2023
6419982
Feat [#16] 썸네일
narinn-star Aug 26, 2023
7458dee
Feat [#16] PostList completed
narinn-star Aug 27, 2023
a6df9a0
Merge pull request #40 from inje-megabrain/PostList
narinn-star Aug 27, 2023
b0a94df
Feat [#11] MyPost_Edit
narinn-star Aug 27, 2023
e19d638
Merge pull request #41 from inje-megabrain/MyPost
narinn-star Aug 27, 2023
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
43 changes: 23 additions & 20 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"env": {
"browser": true,
"node": true
},
"parserOptions": {
"project": ["./tsconfig.json"]
},
"plugins":["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"prettier"
]
}
"root": true,
"parser": "@typescript-eslint/parser",
"env": {
"browser": true,
"node": true
},
"parserOptions": {
"project": ["./tsconfig.json"]
},
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"prettier"
],
"rules": {
//"react/react-in-jsx-scope": "off"
}
}
67 changes: 67 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#main.yml
name: master

on:
push:
branches: [develop]

env:
AWS_REGION: ap-northeast-2
S3_BUCKET_NAME: pick-read-me-actions-s3-bucket
CODE_DEPLOY_APPLICATION_NAME: pick-read-me-codedeploy-app
CODE_DEPLOY_DEPLOYMENT_GROUP_NAME: pick-read-me-codedeploy-group-front

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-master-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-
${{ runner.OS }}-

- name: Install Dependencies
run: yarn

- name: Build
run: yarn build

- name: appspec.yml
run: mv ./appspec.yml ./build

- name: Include Scripts
run: mv ./deploy.sh ./build

# AWS 인증 (IAM 사용자 Access Key, Secret Key 활용)
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}

# (5) 빌드 결과물을 S3 버킷에 업로드 /fe폴더내에
- name: Upload to AWS S3
run: |
aws deploy push \
--application-name ${{ env.CODE_DEPLOY_APPLICATION_NAME }} \
--ignore-hidden-files \
--s3-location s3://$S3_BUCKET_NAME/fe/$GITHUB_SHA.zip \
--source ./build


# S3 버킷에 있는 파일을 대상으로 CodeDeploy 실행
- name: Deploy to AWS EC2 from S3
run: |
aws deploy create-deployment \
--application-name ${{ env.CODE_DEPLOY_APPLICATION_NAME }} \
--deployment-config-name CodeDeployDefault.AllAtOnce \
--deployment-group-name ${{ env.CODE_DEPLOY_DEPLOYMENT_GROUP_NAME }} \
--s3-location bucket=$S3_BUCKET_NAME,key=fe/$GITHUB_SHA.zip,bundleType=zip
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
node_modules
node_modules/
build/
19 changes: 19 additions & 0 deletions appspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 0.0
os: linux

files:
- source: /
destination: /home/ubuntu/front
overwrite: yes

permissions:
- object: /home/ubuntu/front
pattern: "**"
owner: ubuntu
group: ubuntu

hooks:
AfterInstall:
- location: deploy.sh
timeout: 60
runas: ubuntu
11 changes: 11 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
echo "> [$(date +%y-%m-%d/%H:%M)] Deploy React" >> /home/ubuntu/front/deploy.sh

pm2 kill
pm2 serve /home/ubuntu/front/build 3000 --spa --name front
# REPOSITORY=/home/ubuntu/front

# cd $REPOSITORY

# sudo yarn install

# sudo npx pm2 reload all
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,32 @@
"name": "PickreadMe",
"version": "1.0.0",
"main": "./index.js",
"homepage": "http://pickreadme.site",
"license": "MIT",
"proxy": "http://52.78.80.150:9000",
"dependencies": {
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.5",
"@types/file-saver": "^2.0.5",
"@types/node": "^20.5.6",
"@types/react-router-dom": "^5.3.3",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"@uiw/react-md-editor": "^3.23.3",
"axios": "^1.4.0",
"daisyui": "^2.51.6",
"dom-to-image": "^2.6.0",
"eslint": "^8.40.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"file-loader": "^6.2.0",
"file-saver": "^2.0.5",
"framer-motion": "^10.12.16",
"html2canvas": "^1.4.1",
"react": "^18.2.0",
"react-cookie": "^4.1.1",
"react-dom": "^18.2.0",
"react-icons": "^4.9.0",
"react-query": "^3.39.3",
"react-router-dom": "^6.11.1",
"typescript": "^5.0.4",
Expand All @@ -27,6 +41,7 @@
"devDependencies": {
"@babel/core": "^7.21.8",
"@babel/preset-env": "^7.21.5",
"@types/dom-to-image": "^2.6.4",
"@types/react": "^18.2.6",
"@types/react-dom": "^18.2.4",
"autoprefixer": "^10.4.14",
Expand Down
13 changes: 8 additions & 5 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PickReadMe</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> -->
<title>PickReadMe</title>
<script src="/build/bundle.js"></script>
<link rel="shortcut icon" href="#">
</head>

<body>
<div id="root"></div>
<div id="root"></div>
</body>

</html>
1 change: 1 addition & 0 deletions src/Api/ constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const BASE_URL = 'http://52.78.80.150:9000';
20 changes: 20 additions & 0 deletions src/Api/Cookies.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Cookies } from 'react-cookie';

const cookies = new Cookies();

// export const setCookie = (...args: Parameters<(typeof cookies)['set']>) => {
// console.log('+', ...args);
// return cookies.set(...args);
// };

export const setCookie = (name: string, value: string, option?: any) => {
return cookies.set(name, value, { ...option });
};

export const getCookie = (name: string) => {
return cookies.get(name);
};

export const removeCookie = (name: string) => {
return cookies.remove(name);
};
115 changes: 115 additions & 0 deletions src/Api/client.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import axios from 'axios';
import { getCookie, removeCookie, setCookie } from './Cookies';
import { BASE_URL } from './ constants';
import logout from './logout';
import fetchAccess from './fetchAccess';

const ACCESS_HEADER_KEY = 'accessToken';
const REFRESH_HEADER_KEY = 'refreshToken';
const TOKEN_TYPE = 'Bearer';

const client = axios.create({
baseURL: BASE_URL,
withCredentials: true,
});

client.interceptors.request.use((req) => {
return req;
});

client.interceptors.response.use(
(res) => {
if (res.status === 200 && res.data) {
const token = res.data as { accessToken?: string; refreshToken?: string };
if (token.accessToken) {
setAccessToken(token.accessToken);
}
if (token.refreshToken) {
setRefreshToken(token.refreshToken);
}
}
return res;
},
async (error) => {
//console.log(error);
if (error.response.status === 401) {
if (error.response.data.includes('refresh')) {
// refresh 토큰 만료, refresh 토큰 없음
logout()
.then(() => {
console.log('로그아웃');
removeCookie('refreshToken');
})
.then(() => {
window.location.href = '/';
console.log(
'RefreshToken 만료로 로그아웃 합니다. 다시 로그인해주세요.'
);
});
}
if (error.response.data.includes('access')) {
// 엑세스 토큰 만료, 없음
await fetchAccess()
.then(async (v) => {
error.config.headers = {
'Content-Type': 'application/json',
accessToken: v.data,
};
localStorage.setItem('accessToken', v.data);
const response = await axios.request(error.config);
return response;
})
.then(() => {
window.location.reload();
});
}
if (error.response.data.includes('IP')) {
logout()
.then(() => {
console.log('등록된 IP가 있어 로그아웃합니다.');
removeCookie('refreshToken');
})
.then(() => {
window.location.href = '/';
});
}
}

return Promise.reject(error);
}
);

export const setRefreshToken = (token: string) => {
if (token) {
client.defaults.headers.common[
REFRESH_HEADER_KEY
] = `${TOKEN_TYPE} ${token}`;
//쿠키 저장
setCookie('refreshToken', `${token}`, {
path: 'http://52.78.80.150:9000',
//path: '/',
//httpOnly: true,
maxAge: 14 * 24 * 60 * 60,
//maxAge: 180,
sameSite: 'none',
secure: true,
});
} else {
delete client.defaults.headers.common[REFRESH_HEADER_KEY];
}
};

export const setAccessToken = (token: string) => {
if (token) {
client.defaults.headers.common[
ACCESS_HEADER_KEY
] = `${TOKEN_TYPE} ${token}`;
//LocalStorage 저장
localStorage.setItem('accessToken', token);
console.log('저장 완료');
} else {
delete client.defaults.headers.common[ACCESS_HEADER_KEY];
}
};

export default client;
20 changes: 20 additions & 0 deletions src/Api/createLike.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import client from './client';
import { getCookie } from './Cookies';

export default function createLike(postId: number) {
return new Promise((resolve) => {
client
.post(`/api/like/posts?post_id=${postId}`, {
headers: {
accessToken: localStorage.getItem('accessToken'),
refreshToken: getCookie('refreshToken'),
},
})
.then((v) => {
resolve(v);
})
.catch((error) => {
console.log('createLike 에러 ' + error);
});
});
}
12 changes: 12 additions & 0 deletions src/Api/deletePost.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import client from './client';

const deletePost = async (postId: number) => {
try {
const res = await client.delete(`/api/delete/posts?post_id=${postId}`, {});
if (res) console.log('삭제 완료');
} catch (error) {
console.log('deletePost 에러 ', error);
}
};

export default deletePost;
Loading
Loading