게시글 사용자 responseDto 대참사
This commit is contained in:
@@ -35,7 +35,6 @@
|
||||
},
|
||||
async beforeCreate() {
|
||||
authService.banishIfUserUnAuthenticated = authService.banishIfUserUnAuthenticated.bind(this);
|
||||
|
||||
articleService.getArticle = articleService.getArticle.bind(this);
|
||||
articleService.removeArticle = articleService.removeArticle.bind(this);
|
||||
},
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ export default {
|
||||
}
|
||||
|
||||
try {
|
||||
console.log(user, session);
|
||||
if (user.id !== session.id) {
|
||||
throw new Error("현재 사용자가 해당 게시글에 권한이 없습니다.");
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user