게시글 사용자 responseDto 대참사

This commit is contained in:
이진석
2020-02-06 15:04:59 +09:00
parent 69f6314c31
commit 7dfac23726
6 changed files with 6 additions and 29 deletions

View File

@@ -35,7 +35,6 @@
},
async beforeCreate() {
authService.banishIfUserUnAuthenticated = authService.banishIfUserUnAuthenticated.bind(this);
articleService.getArticle = articleService.getArticle.bind(this);
articleService.removeArticle = articleService.removeArticle.bind(this);
},

View File

@@ -24,14 +24,10 @@
</template>
<script>
import articleApi from "../../api/articleApi";
import authentication from "../../middlewares/authentication";
import authApi from "../../api/authApi";
import commonUtil from "../../utils/commonUtil";
import authService from "../../services/authService";
import articleService from "../../services/articleService";
import authService from "../../services/authService";
import articleService from "../../services/articleService";
export default {
export default {
name: "List",
data() {
return {

View File

@@ -47,7 +47,6 @@
this.title = title;
this.content = content;
this.isEdit = true;
}
},
methods: {
@@ -55,13 +54,11 @@
evt.preventDefault();
const {title, content} = this;
await articleService.postArticle({title, content});
},
async update(evt) {
evt.preventDefault();
const id = this.$route.query.id;
const {title, content} = this;
await articleService.updateArticle(id, {title, content});
await articleService.updateArticle(this.$route.query.id, {title, content});
}
}
}

View File

@@ -37,21 +37,7 @@
submit: async function(evt) {
evt.preventDefault();
const { email, password } = this;
await authService.login(email,password);
// try {
// const result = await authApi.login({email, password});
// const { token } = result.data;
// this.$cookie.set('accessToken', token, 1000);
// await this.$router.push('/articles');
// } catch (err) {
// const message = err.response.data.message;
// if (~message.indexOf('패스워드')) {
// alert('패스워드가 일치하지 않습니다.');
// }
// }
await authService.login(email,password);
},
}
}

View File

@@ -62,7 +62,6 @@ export default {
}
try {
console.log(user, session);
if (user.id !== session.id) {
throw new Error("현재 사용자가 해당 게시글에 권한이 없습니다.");
}

View File

@@ -27,6 +27,6 @@ public class ArticleResponseDto {
this.createdAt = article.getCreatedAt();
this.updatedAt = article.getUpdatedAt();
this.isOwn = article.compareUser(user);
this.user = new UserResponseDto(user);
this.user = new UserResponseDto(article.getUser());
}
}