Skip to content
Open
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 .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unsafe-perm=true
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"author": "DANNIEL <donghoon149@gmail.com>",
"license": "MIT",
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
"dev": "next dev",
"start": "next start",
"build": "npm run clean && next build",
"clean": "rm -rf .next"
},
"dependencies": {
"@fullpage/react-fullpage": "0.1.17",
Expand Down
11 changes: 6 additions & 5 deletions pages/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ const Index = () => {
const classes = useStyles();
const [name, setName] = useState('');
const [password, setPassword] = useState('');
const onSubmit = async () => {
const onSubmit = () => {
const trimmedPassword = password.trim()
try {
await rollingService.postRolling(name, password).then(async (res) => {
rollingService.postRolling(name, trimmedPassword).then(async (res) => {
console.log(res);
window.location.href = `/sender/main?name=${name}&num=${password}`;
window.location.href = `/sender/main?name=${name}&num=${trimmedPassword}`;
});
} catch (err) {
console.log(err);
Expand Down Expand Up @@ -125,8 +126,8 @@ const Index = () => {
생성 및 조회하기
</Buttons>
) : (
<Buttons full={true}>모두 작성해주세요</Buttons>
)}
<Buttons full={true}>모두 작성해주세요</Buttons>
)}
</StickyFooter>
</Layouts>
</div>
Expand Down
25 changes: 1 addition & 24 deletions services/rollingService.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios from 'axios';

// let BASE_URL = "https://donghoon.tk";

let BASE_URL = 'https://apis.rollingpaper.site';
let BASE_URL = 'https://apilb.rollingpaper.site';

const baseAPI = axios.create({
baseURL: BASE_URL,
Expand All @@ -23,16 +23,6 @@ const rollingService = {
console.log(res);
return res.data || [];
},

// getRollingByName: async (name, password) => {
// // const name = "ddd";
// // const password = "dd";
// console.log(name, password);
// let res = await baseAPI.get(
// `/api/rolling?name=${encodeURI(name)}&password=${encodeURI(password)}`
// );
// return res.data || [];
// },
getRolling: async () => {
let res = await baseAPI.get(`/api/v1/count`);
return res.data || [];
Expand Down Expand Up @@ -91,19 +81,6 @@ const rollingService = {

throw new Error(message);
},
// postRolling: async (object) => {
// console.log("ddd");
// await baseAPI
// .post(`/api/rolling`, object)
// .then((res) => {
// console.log(res.data);
// return 1;
// })
// .catch((err) => {
// console.log(err);
// return 0;
// });
// },
postRolling: async (receiver, password) => {
console.log('postRolling : ', receiver, password);
await baseAPI
Expand Down