Skip to content

Commit

Permalink
Regular updates (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 authored Oct 29, 2023
1 parent 829fdad commit c6ad53a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 37 deletions.
28 changes: 14 additions & 14 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
"dependencies": {
"@nivo/bar": "^0.80.0",
"@nivo/core": "^0.80.0",
"axios": "^1.5.1",
"axios": "^1.6.0",
"moment": "^2.29.4",
"next": "^12.3.4",
"react": "^17.0.2",
"react-dom": "17.0.2",
"react-responsive": "^9.0.2",
"semantic-ui-css": "^2.5.0",
"semantic-ui-react": "^2.1.4",
"styled-components": "^5.3.10"
"styled-components": "^5.3.11"
},
"devDependencies": {
"eslint": "^8.52.0",
Expand Down
1 change: 1 addition & 0 deletions pages/board/benefit/affiliate/create.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const AffiliateCreatePage = () => {
<Form.TextArea
required
label={'설명'}
style={{height: 300}}
onChange={e => setContent(e.target.value)}
/>

Expand Down
1 change: 1 addition & 0 deletions pages/board/benefit/discount/create.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const DiscountCreatePage = () => {
<Form.TextArea
required
label={'설명'}
style={{height: 300}}
onChange={e => setContent(e.target.value)}
/>

Expand Down
36 changes: 15 additions & 21 deletions pages/board/setting.jsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
import { useEffect, useState } from 'react'
import { useState } from 'react'
import { Form } from 'semantic-ui-react'

import BoardLayout from '@/components/board/board.layout'
import { PoPoAxios, PopoCdnAxios } from '@/utils/axios.instance';
import { PoPoAxios } from '@/utils/axios.instance';

const SettingPage = () => {
const [popoCRMEmail, setPOPOCRMEmail] = useState('');
const [dongyeonBank, setDongyeonBank] = useState('');
const [dongyeonServiceTime, setDongyeonServiceTime] = useState('');
const [dongyeonContact, setDongyeonContact] = useState('');

useEffect(() => {
PoPoAxios.get('/setting')
.then((res) => {
setPOPOCRMEmail(res.data.popo_crm_email);
setDongyeonBank(res.data.dongyeon_bank);
setDongyeonServiceTime(res.data.dongyeon_service_time);
setDongyeonContact(res.data.dongyeon_contact);
}).catch((err) => {
const errMsg = err.response.data.message;
alert(`설정값을 불러오는데 실패했습니다.\n${errMsg}`);
})
}, [])
const SettingPage = ({ settingKeyValue }) => {
const [popoCRMEmail, setPOPOCRMEmail] = useState(settingKeyValue.popo_crm_email);
const [dongyeonBank, setDongyeonBank] = useState(settingKeyValue.dongyeon_bank);
const [dongyeonServiceTime, setDongyeonServiceTime] = useState(settingKeyValue.dongyeon_service_time);
const [dongyeonContact, setDongyeonContact] = useState(settingKeyValue.dongyeon_contact);

function handleSubmit () {
PoPoAxios.post('/setting', {
Expand Down Expand Up @@ -78,4 +65,11 @@ const SettingPage = () => {
)
}

export default SettingPage
export default SettingPage

export async function getServerSideProps() {
const res = await PoPoAxios.get('/setting');
const settingKeyValue = res.data;

return { props: { settingKeyValue } }
}

0 comments on commit c6ad53a

Please sign in to comment.