Skip to content

Commit

Permalink
Merge pull request #195 from Quickchive/feature/collection
Browse files Browse the repository at this point in the history
feat: 콜렉션 관련 기능 삭제
  • Loading branch information
oseunghyun authored Dec 29, 2022
2 parents 81c0738 + 8832bd3 commit b55137a
Show file tree
Hide file tree
Showing 21 changed files with 127 additions and 1,447 deletions.
28 changes: 0 additions & 28 deletions src/api/collection.js

This file was deleted.

18 changes: 6 additions & 12 deletions src/api/user.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
import { instance, authInstance } from "./index";
import { instance, authInstance } from './index';

// 프로필 수정
function editProfile(userData) {
return authInstance.post("users/edit", userData);
return authInstance.post('users/edit', userData);
}

// 비밀번호 재설정
function resetPw(pwData) {
return instance.post("users/reset-password", pwData);
return instance.post('users/reset-password', pwData);
}

// 프로필 조회
function fetchProfile() {
return authInstance.get("users/me");
return authInstance.get('users/me');
}

// 자신의 콘텐츠 조회
function fetchMyContents(categoryId) {
return authInstance.get(`users/load-contents?categoryId=${categoryId}`);
}

// 자신의 콜렉션 조회
function fetchMyCollections(categoryId) {
return authInstance.get(`users/load-collections?categoryId=${categoryId}`);
}

// 자신의 카테고리 목록 조회
function fetchMyCategory() {
return authInstance.get("users/load-categories");
return authInstance.get('users/load-categories');
}

// 자신의 즐겨찾기 조회
function fetchMyFavorites() {
return authInstance.get("users/load-favorites");
return authInstance.get('users/load-favorites');
}

export {
Expand All @@ -41,6 +36,5 @@ export {
fetchProfile,
fetchMyContents,
fetchMyCategory,
fetchMyCollections,
fetchMyFavorites,
};
74 changes: 25 additions & 49 deletions src/components/MainComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,14 @@
@close-modal="isModalActive = false"
@isLinkNotSingle="isLinkNotSingle"
:linkList="linkList"
@openCollectionModal="openCollectionModal"
></contents-modal-component>

<!-- 링크 2개 이상일 경우 모달 컴포넌트 -->

<confirm-modal-component
v-if="isConfirmModalActive"
@rightBtn="addMultipleContents()"
@leftBtn="openCollectionModal(linkList)"
@close-modal="isConfirmModalActive = false"
@leftBtn="addMultipleContents()"
@rightBtn="isConfirmModalActive = false"
:confirmModalContent="confirmModalContent"
:leftBtnMessage="leftBtnMessage"
:rightBtnMessage="rightBtnMessage"
Expand All @@ -75,30 +73,21 @@
:btnMessage="btnMessage"
>
</alert-modal-component>

<!-- 콜렉션으로 저장 모달 -->

<collection-modal-component
v-if="isCollectionModalActive"
@close-modal="isCollectionModalActive = false"
:collectionData="collectionData"
></collection-modal-component>
</div>
</template>

<script>
import CategoryListFavorite from "@/components/categorylist/CategoryListFavorite.vue";
import CategoryListAll from "@/components/categorylist/CategoryListAll.vue";
import CategoryList from "@/components/categorylist/CategoryList.vue";
import CategoryModalComponent from "./modal/CategoryModalComponent.vue";
import plusBtn from "@/assets/icon/plusBtn.svg";
import topBtn from "@/assets/icon/topBtn.svg";
import ContentsModalComponent from "./modal/ContentsModalComponent.vue";
import ConfirmModalComponent from "@/components/modal/ConfirmModalComponent.vue";
import AlertModalComponent from "./modal/AlertModalComponent.vue";
import { addMultipleContents } from "@/api/contents";
import { addCategory } from "@/api/category";
import CollectionModalComponent from "@/components/modal/CollectionModalComponent.vue";
import CategoryListFavorite from '@/components/categorylist/CategoryListFavorite.vue';
import CategoryListAll from '@/components/categorylist/CategoryListAll.vue';
import CategoryList from '@/components/categorylist/CategoryList.vue';
import CategoryModalComponent from './modal/CategoryModalComponent.vue';
import plusBtn from '@/assets/icon/plusBtn.svg';
import topBtn from '@/assets/icon/topBtn.svg';
import ContentsModalComponent from './modal/ContentsModalComponent.vue';
import ConfirmModalComponent from '@/components/modal/ConfirmModalComponent.vue';
import AlertModalComponent from './modal/AlertModalComponent.vue';
import { addMultipleContents } from '@/api/contents';
import { addCategory } from '@/api/category';
export default {
components: {
Expand All @@ -109,7 +98,6 @@ export default {
CategoryModalComponent,
ConfirmModalComponent,
AlertModalComponent,
CollectionModalComponent,
},
data() {
return {
Expand All @@ -118,33 +106,28 @@ export default {
isModalActive: false,
isConfirmModalActive: false,
isAlertModalActive: false,
isCollectionModalActive: false,
topBtn,
// confirm 모달 메시지
confirmModalContent: "URL이 2개 이상이네요! \n 저장방식을 선택해주세요",
leftBtnMessage: "콜렉션으로 저장",
rightBtnMessage: "각각 콘텐츠로 저장",
isClosBtnShow: true,
confirmModalContent:
'URL이 2개 이상이네요! \n 각각 콘텐츠로 저장하시겠습니까?',
leftBtnMessage: '',
rightBtnMessage: '아니오',
isClosBtnShow: false,
// alert 모달 메시지
alertModalContent: "같은 카테고리에 동일 링크가 \n 이미 저장되었습니다.",
btnMessage: "",
alertModalContent: '같은 카테고리에 동일 링크가 \n 이미 저장되었습니다.',
btnMessage: '',
contentsLinks: [],
// 카테고리 모달 제목
categoryModalTitle: "카테고리 추가",
categoryName: "",
categoryModalTitle: '카테고리 추가',
categoryName: '',
// 내 카테고리 목록
myCategories: {},
categoryAll: "전체",
categoryAll: '전체',
linkList: [],
collectionData: {
contentLinkList: [],
favorite: false,
},
collectionModalTitle: "콜렉션 추가",
};
},
async created() {
await this.$store.dispatch("GET_CATEGORIES");
await this.$store.dispatch('GET_CATEGORIES');
this.myCategories = this.$store.getters.getCategories;
},
computed: {
Expand All @@ -166,7 +149,7 @@ export default {
categoryName: this.categoryName,
};
await addCategory(data);
await this.$store.dispatch("GET_CATEGORIES");
await this.$store.dispatch('GET_CATEGORIES');
this.myCategories = this.$store.getters.getCategories;
} catch (error) {
this.alertModalContent = error.response.data.message;
Expand Down Expand Up @@ -208,13 +191,6 @@ export default {
toFavoriteCategoryPage() {
this.$router.push(`/category/favorite`);
},
// 콜렉션 추가 모달 열기
openCollectionModal(linkList) {
this.collectionData.contentLinkList = linkList;
this.isConfirmModalActive = false;
this.isModalActive = false;
this.isCollectionModalActive = true;
},
},
};
</script>
Expand Down
83 changes: 29 additions & 54 deletions src/components/MainComponentSocial.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,13 @@
@close-modal="isModalActive = false"
@isLinkNotSingle="isLinkNotSingle"
:linkList="linkList"
@openCollectionModal="openCollectionModal"
></contents-modal-component>

<!-- 링크 2개 이상일 경우 모달 컴포넌트 -->

<confirm-modal-component
v-if="isConfirmModalActive"
@rightBtn="addMultipleContents()"
@leftBtn="openCollectionModal(linkList)"
@close-modal="isConfirmModalActive = false"
:confirmModalContent="confirmModalContent"
:leftBtnMessage="leftBtnMessage"
Expand All @@ -75,30 +73,21 @@
:btnMessage="btnMessage"
>
</alert-modal-component>

<!-- 콜렉션으로 저장 모달 -->

<collection-modal-component
v-if="isCollectionModalActive"
@close-modal="isCollectionModalActive = false"
:collectionData="collectionData"
></collection-modal-component>
</div>
</template>

<script>
import CategoryListFavorite from "@/components/categorylist/CategoryListFavorite.vue";
import CategoryListAll from "@/components/categorylist/CategoryListAll.vue";
import CategoryList from "@/components/categorylist/CategoryList.vue";
import CategoryModalComponent from "./modal/CategoryModalComponent.vue";
import plusBtn from "@/assets/icon/plusBtn.svg";
import topBtn from "@/assets/icon/topBtn.svg";
import ContentsModalComponent from "./modal/ContentsModalComponent.vue";
import ConfirmModalComponent from "@/components/modal/ConfirmModalComponent.vue";
import AlertModalComponent from "./modal/AlertModalComponent.vue";
import { addMultipleContents } from "@/api/contents";
import { addCategory } from "@/api/category";
import CollectionModalComponent from "@/components/modal/CollectionModalComponent.vue";
import CategoryListFavorite from '@/components/categorylist/CategoryListFavorite.vue';
import CategoryListAll from '@/components/categorylist/CategoryListAll.vue';
import CategoryList from '@/components/categorylist/CategoryList.vue';
import CategoryModalComponent from './modal/CategoryModalComponent.vue';
import plusBtn from '@/assets/icon/plusBtn.svg';
import topBtn from '@/assets/icon/topBtn.svg';
import ContentsModalComponent from './modal/ContentsModalComponent.vue';
import ConfirmModalComponent from '@/components/modal/ConfirmModalComponent.vue';
import AlertModalComponent from './modal/AlertModalComponent.vue';
import { addMultipleContents } from '@/api/contents';
import { addCategory } from '@/api/category';
export default {
components: {
Expand All @@ -109,7 +98,6 @@ export default {
CategoryModalComponent,
ConfirmModalComponent,
AlertModalComponent,
CollectionModalComponent,
},
data() {
return {
Expand All @@ -118,61 +106,55 @@ export default {
isModalActive: false,
isConfirmModalActive: false,
isAlertModalActive: false,
isCollectionModalActive: false,
topBtn,
// confirm 모달 메시지
confirmModalContent: "URL이 2개 이상이네요! \n 저장방식을 선택해주세요",
leftBtnMessage: "콜렉션으로 저장",
rightBtnMessage: "각각 콘텐츠로 저장",
confirmModalContent: 'URL이 2개 이상이네요! \n 저장방식을 선택해주세요',
leftBtnMessage: '콜렉션으로 저장',
rightBtnMessage: '각각 콘텐츠로 저장',
isClosBtnShow: true,
// alert 모달 메시지
alertModalContent: "같은 카테고리에 동일 링크가 \n 이미 저장되었습니다.",
btnMessage: "",
alertModalContent: '같은 카테고리에 동일 링크가 \n 이미 저장되었습니다.',
btnMessage: '',
contentsLinks: [],
// 카테고리 모달 제목
categoryModalTitle: "카테고리 추가",
categoryName: "",
categoryModalTitle: '카테고리 추가',
categoryName: '',
// 내 카테고리 목록
myCategories: {},
categoryAll: "전체",
categoryAll: '전체',
linkList: [],
collectionData: {
contentLinkList: [],
favorite: false,
},
collectionModalTitle: "콜렉션 추가",
};
},
async created() {
// 카테고리 조회
const path = this.$route.path;
const loginInfo = path.slice(6);
if (loginInfo == "google/redirect") {
localStorage.setItem("oauthInfo", "google");
if (loginInfo == 'google/redirect') {
localStorage.setItem('oauthInfo', 'google');
try {
const code = this.$route.query.code;
await this.$store.dispatch("GOOGLE_LOGIN", code);
await this.$store.dispatch('GOOGLE_LOGIN', code);
} catch (error) {
this.alertModalContent = error.response.data.message;
this.isAlertModalActive = true;
} finally {
await this.$store.dispatch("GET_CATEGORIES");
await this.$store.dispatch('GET_CATEGORIES');
this.myCategories = this.$store.getters.getCategories;
}
} else if (loginInfo == "kakao/redirect") {
localStorage.setItem("oauthInfo", "kakao");
} else if (loginInfo == 'kakao/redirect') {
localStorage.setItem('oauthInfo', 'kakao');
try {
const code = this.$route.query.code;
await this.$store.dispatch("KAKAO_LOGIN", code);
await this.$store.dispatch('KAKAO_LOGIN', code);
} catch (error) {
this.alertModalContent = error.response.data.message;
this.isAlertModalActive = true;
} finally {
await this.$store.dispatch("GET_CATEGORIES");
await this.$store.dispatch('GET_CATEGORIES');
this.myCategories = this.$store.getters.getCategories;
}
} else {
await this.$store.dispatch("GET_CATEGORIES");
await this.$store.dispatch('GET_CATEGORIES');
this.myCategories = this.$store.getters.getCategories;
}
},
Expand All @@ -195,7 +177,7 @@ export default {
categoryName: this.categoryName,
};
await addCategory(data);
await this.$store.dispatch("GET_CATEGORIES");
await this.$store.dispatch('GET_CATEGORIES');
this.myCategories = this.$store.getters.getCategories;
} catch (error) {
this.alertModalContent = error.response.data.message;
Expand Down Expand Up @@ -236,13 +218,6 @@ export default {
toFavoriteCategoryPage() {
this.$router.push(`/category/favorite`);
},
// 콜렉션 추가 모달 열기
openCollectionModal(linkList) {
this.collectionData.contentLinkList = linkList;
this.isConfirmModalActive = false;
this.isModalActive = false;
this.isCollectionModalActive = true;
},
},
};
</script>
Expand Down
Loading

0 comments on commit b55137a

Please sign in to comment.