Skip to content

Commit dfb2b1c

Browse files
author
haru
committed
Merge branch 'develop' into feature/seoung
2 parents d98ebb2 + 2346133 commit dfb2b1c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1786
-23
lines changed

eslint.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ const config = [
4646
'import/no-anonymous-default-export': [
4747
'error',
4848
{
49-
allowArrowFunction: false,
49+
allowArrowFunction: true,
5050
allowAnonymousFunction: false,
5151
allowAnonymousClass: false,
5252
},
5353
],
5454

55-
'func-style': ['warn', 'declaration', { allowArrowFunctions: false }],
55+
'func-style': ['warn', 'declaration', { allowArrowFunctions: true }],
5656
},
5757
settings: {
5858
react: {

package-lock.json

Lines changed: 144 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"axios": "^1.5.0",
1616
"react": "^18.2.0",
1717
"react-dom": "^18.2.0",
18+
"react-quill": "^2.0.0",
1819
"react-router-dom": "^6.16.0",
1920
"sass": "^1.67.0"
2021
},

src/App.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
import './assets/styles/base.scss';
22
import { Route, Routes } from 'react-router-dom';
33
import Header from './components/layout/Header/Header';
4-
import Test from './pages/List-page/Test';
4+
import RecipientList from './pages/RecipientList/RecipientList';
55
import Home from './pages/Home/Home';
6+
import CreateRecipient from './pages/CreateRecipient/CreateRecipient';
7+
import Recipient from './pages/Recipient/Recipient';
8+
import MessageForm from './pages/MessageForm/MessageForm';
69

710
export default function App() {
811
return (
912
<>
1013
<Header />
1114
<Routes>
1215
<Route path="/" element={<Home />} />
13-
<Route path="/" element={<Test />} />
16+
<Route path="/list" element={<RecipientList />} />
17+
<Route path="/post" element={<CreateRecipient />} />
18+
<Route path="/post/:id" element={<Recipient />} />
19+
<Route path="/post/:id/message" element={<MessageForm />} />
1420
</Routes>
1521
</>
1622
);

src/api/api.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import axios from 'axios';
2+
3+
export const api = axios.create({
4+
baseURL: import.meta.env.VITE_API_BASE_URL,
5+
headers: { 'Content-Type': 'application/json' },
6+
timeout: 5000,
7+
});
8+
9+
api.interceptors.response.use(
10+
(res) => res,
11+
(error) => {
12+
const status = error.response?.status;
13+
if (status === 404) {
14+
alert('요청한 자원을 찾을 수 없습니다.');
15+
} else if (status === 500) {
16+
alert('서버에 문제가 발생했습니다.');
17+
} else {
18+
alert('문제가 발생했습니다.');
19+
}
20+
return Promise.reject(error);
21+
},
22+
);

src/api/fetchProfileImages.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { api } from './api';
2+
3+
export default async function fetchProfileImages() {
4+
try {
5+
const res = await api.get('/profile-images/');
6+
return res.data.imageUrls;
7+
} catch {
8+
return [];
9+
}
10+
}

0 commit comments

Comments
 (0)