Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MERGE] 1차 릴리즈 시작 전까지의 내용 main브랜치에 합치기 #102

Open
wants to merge 126 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
d96db07
[CHORE] CORS 에러 관련 수정
laalaa31 Jul 19, 2022
0da8318
Merge branch 'main' into develop
laalaa31 Jul 19, 2022
becd5f6
[FEAT] 혼자 패킹 카테고리 생성
kkl4846 Jul 19, 2022
0eae9b8
[FIX] CORS 에러 관련 수정
laalaa31 Jul 19, 2022
302a485
[FEAT]/#64 혼자 패킹 카테고리 수정 & id -> _id
kkl4846 Jul 19, 2022
7fb8725
[FEAT]/#66 혼자패킹리스트 상세조회
laalaa31 Jul 19, 2022
c91fe95
[MERGE]#66 혼자패킹리스트 상세 조회 merge
laalaa31 Jul 19, 2022
14b71cc
Merge branch 'develop' into feature/hz
hyeon-z Jul 19, 2022
ea1bd00
[CHORE] 함께 패킹리스트 카테고리 id를 _id로 수정
hyeon-z Jul 19, 2022
f938f17
[CHORE] console.log 삭제
hyeon-z Jul 19, 2022
56d9bfb
[CHORE] 함께 패킹리스트 짐 id를 _id로 수정
hyeon-z Jul 19, 2022
0516943
Merge pull request #71 from Team-Packman/feature/hz
hyeon-z Jul 19, 2022
a934b9c
[FEAT]/#61 폴더 안 함께 패킹 리스트 조회 구현
hyeon-z Jul 19, 2022
ff6c61d
[FEAT]/#70 폴더 속 혼자 패킹리스트 구현
laalaa31 Jul 19, 2022
40057c6
Merge pull request #72 from Team-Packman/feature/#61
hyeon-z Jul 19, 2022
9f396e3
[MERGE]#70 폴더 속 혼자 패킹리스트 구현 merge
laalaa31 Jul 19, 2022
0172a11
[FEAT]/#63 폴더 속 혼자 패킹리스트 조회 구현
laalaa31 Jul 20, 2022
5b0a866
[FEAT]/#68 멤버 조회
kkl4846 Jul 20, 2022
6914537
[ADD] map 대신 for await으로 변경
kkl4846 Jul 20, 2022
3a4770f
Merge pull request #76 from Team-Packman/feature/#68
kkl4846 Jul 20, 2022
ee8428b
[FEAT]/#75 혼자 패킹리스트 삭제 시 폴더 내에서 삭제
laalaa31 Jul 20, 2022
bc9f3cf
[FEAT] 함께 패킹에 group response 추가
kkl4846 Jul 20, 2022
66487b5
Merge pull request #78 from Team-Packman/feature/#77
kkl4846 Jul 20, 2022
137e322
[FIX] nickname -> name으로 수정
kkl4846 Jul 20, 2022
6e40aef
Merge branch 'feature/#77' into develop
kkl4846 Jul 20, 2022
0284971
[FEAT]/#75 함께 패킹리스트 삭제시 폴더 내에서 삭제
laalaa31 Jul 20, 2022
749d90a
[MERGE] 혼자, 함께 패킹리스트 삭제 시 폴더 내 삭제 구현 merge
laalaa31 Jul 20, 2022
05d3392
Merge branch 'develop' into feature/#62
kkl4846 Jul 20, 2022
2e9a8e9
[MERGE] #62 into develop
kkl4846 Jul 20, 2022
6ebca20
[FEAT]/#63 폴더 속 혼자 패킹리스트들 조회 구현
laalaa31 Jul 20, 2022
44431e8
[MERGE]#63 폴더 속 혼자 패킹리스트들 조회 구현 merge
laalaa31 Jul 20, 2022
1a41da1
[FEAT] 함께 패킹리스트 그룹 생성시 본인 추가 구현
laalaa31 Jul 20, 2022
949e5a8
[FIX] 멤버에 유저가 없을 때 null return 제거
kkl4846 Jul 20, 2022
5536307
Merge branch 'feature/#77' into develop
kkl4846 Jul 20, 2022
8e575a7
Merge pull request #82 from Team-Packman/feature/sh
laalaa31 Jul 20, 2022
8afeaed
[FEAT]/#80 함께 패킹 리스트 삭제
kkl4846 Jul 20, 2022
89fbf7e
[MERGE]/#80 merge develop
kkl4846 Jul 20, 2022
cf28449
[FEAT]/#83 혼자 패킹리스트 짐 생성 구현
laalaa31 Jul 20, 2022
025f774
[MERGE]#83 혼자 패킹리스트 짐 생성 구현 merge
laalaa31 Jul 20, 2022
3923bf4
[ADD]/#73 dayjs 추가
hyeon-z Jul 20, 2022
cc188d5
[FEAT]/#73 최근 생성된 리스트 조회 구현
hyeon-z Jul 20, 2022
540111a
Merge branch 'feature/#73' into develop
hyeon-z Jul 20, 2022
cc00f73
[FEAT]/#85 혼자 패킹리스트 짐 수정
kkl4846 Jul 20, 2022
4065ec8
[FEAT]/#85 packNum 기능 추가
kkl4846 Jul 20, 2022
74073ab
[MERGE] #85 into develop
kkl4846 Jul 20, 2022
2e09b6f
[FEAT]/#87 혼자패킹리스트 짐 삭제
laalaa31 Jul 20, 2022
718386a
Revert "Merge branch 'feature/#73' into develop"
hyeon-z Jul 20, 2022
d6edb70
Merge remote-tracking branch 'origin/develop' into develop
hyeon-z Jul 20, 2022
748440b
[FEAT]/#87 패킹리스트 짐 삭제 구현
laalaa31 Jul 20, 2022
fd4e752
Merge pull request #89 from Team-Packman/feature/#87
laalaa31 Jul 20, 2022
0c9a0f2
[DEL] 필요없는 코드 삭제
kkl4846 Jul 20, 2022
b8c51a4
[FEAT]/#73 최근 생성된 리스트 조회 구현
hyeon-z Jul 20, 2022
3ca7850
Merge branch 'develop' into feature/#73
hyeon-z Jul 20, 2022
844fba2
Merge pull request #90 from Team-Packman/feature/#73
hyeon-z Jul 20, 2022
ac2dec1
[CHORE] dayjs 버전 업데이트
hyeon-z Jul 20, 2022
408e049
Merge branch 'develop' into feature/hz
hyeon-z Jul 20, 2022
82abccd
[ADD]/#91 user 구글 로그인 시 isDeleted 처리
kkl4846 Jul 20, 2022
674f896
[MERGE]/#92 merge into develop
kkl4846 Jul 20, 2022
b4ef22c
Merge branch 'develop' into feature/hz
hyeon-z Jul 20, 2022
565eb9e
Merge remote-tracking branch 'origin/develop' into feature/kr
kkl4846 Jul 20, 2022
af7388d
[FIX] response type 소문자로
kkl4846 Jul 20, 2022
24ed3f5
Merge branch 'feature/kr' into develop
kkl4846 Jul 20, 2022
220e064
[CHORE] 카테고리 생성, 수정, 삭제 totalNum, reamainNum 수정
hyeon-z Jul 20, 2022
58fde2a
Merge pull request #94 from Team-Packman/feature/hz
hyeon-z Jul 20, 2022
29bde11
[FIX] get -> post
kkl4846 Jul 20, 2022
303e70e
Merge branch 'develop' into feature/kr
kkl4846 Jul 20, 2022
6c2870c
Merge branch 'feature/kr' into develop
kkl4846 Jul 20, 2022
76ced0c
[FEAT]/#93 카카오 로그인 구현
laalaa31 Jul 20, 2022
cfa9f97
Merge branch 'develop' into feature/#93
laalaa31 Jul 20, 2022
2e4bf8f
Merge pull request #96 from Team-Packman/feature/#93
laalaa31 Jul 20, 2022
c264e8a
[FEAT]/#93 카카오 로그인 경로 수정
laalaa31 Jul 20, 2022
da2fa69
Merge pull request #97 from Team-Packman/feature/#93
laalaa31 Jul 20, 2022
718bf50
[FIX]/#93 카카오 로그인 경로 수정
laalaa31 Jul 20, 2022
e4fd63a
Merge pull request #98 from Team-Packman/feature/#93
laalaa31 Jul 20, 2022
8358071
[FIX]/#93 카카오 로그인 관련 수정
laalaa31 Jul 20, 2022
8ab6d09
[FIX]/#93 카카오 로그인 관련 수정2
laalaa31 Jul 20, 2022
97fd5aa
Merge pull request #99 from Team-Packman/feature/#93
laalaa31 Jul 20, 2022
e07c2e2
[FIX] 혼자 패킹리스트 삭제시 오류 해결
laalaa31 Jul 21, 2022
767a87e
Merge pull request #100 from Team-Packman/feature/sh
laalaa31 Jul 21, 2022
f411eb0
[FIX] find 조건 or을 and로 고침
hyeon-z Jul 21, 2022
dfcc4e2
[FIX] createdAt 순서대로
kkl4846 Jul 21, 2022
d16989c
[ADD] mocha관련 라이브러리 설치
hyeon-z Jul 21, 2022
e29464b
[ADD] mocha test폴더, 파일 생성
hyeon-z Jul 21, 2022
06934c5
[CHORE] 카카오 로그인/회원가입 responseBody 형식 통일
hyeon-z Jul 22, 2022
c81b2aa
[FEAT] Slack Webhook 연결
hyeon-z Jul 22, 2022
383a07d
[FEAT] TEST작성
kkl4846 Jul 22, 2022
fcfcc73
[FEAT] slack webhook controller에 연결
kkl4846 Jul 22, 2022
791ce5f
[FIX] 폴더가 존재하지 않을 때, 리스트가 존재하지 않을 때 오류 해결
hyeon-z Jul 22, 2022
f4646f3
[FIX] 함께 패킹리스트 삭제 오류 수정
laalaa31 Jul 22, 2022
81f3872
Merge pull request #101 from Team-Packman/feature/sh
laalaa31 Jul 22, 2022
30d1160
[ADD] husky 설치
hyeon-z Jul 22, 2022
a8cbc62
Merge remote-tracking branch 'origin/develop' into develop
hyeon-z Jul 22, 2022
c5363fa
[FIX] 폴더 라우터 _id수정
kkl4846 Jul 22, 2022
7cb94a1
Merge remote-tracking branch 'origin/develop' into develop
kkl4846 Jul 22, 2022
17972cf
[ADD] jest 테스트 코드
hyeon-z Jul 22, 2022
0f37594
[UPDATE] readme 수정
laalaa31 Jul 22, 2022
c8736ac
[FIX] 초대 코드 라우터 수정
kkl4846 Jul 22, 2022
c919d57
Merge remote-tracking branch 'origin/develop' into develop
kkl4846 Jul 22, 2022
e01f772
[ADD] 테스트 ㅍ일
kkl4846 Jul 22, 2022
201ca86
[CHORE] 리스트 없을 때 204처리
hyeon-z Jul 22, 2022
201cefe
[CHORE] statusCode 404를 204로 변경
hyeon-z Jul 22, 2022
fa8cf99
[FIX] 잘못된 reponseBody의 url 수정
hyeon-z Jul 22, 2022
5746fc9
[FIX] reponseBody url 재수정
hyeon-z Jul 22, 2022
c173a04
[FIX] responseBody url 수정
hyeon-z Jul 22, 2022
93ef559
[FIX] listNum 추가
kkl4846 Jul 22, 2022
4b47c74
Merge remote-tracking branch 'origin/develop' into develop
kkl4846 Jul 22, 2022
4de52ff
[FIX] Date.now() 오류 해결
hyeon-z Jul 22, 2022
df3fe1b
Merge remote-tracking branch 'origin/develop' into develop
hyeon-z Jul 22, 2022
8ecaa68
[FIX] 폴더 안 리스트 없을 때 에러처리
hyeon-z Jul 22, 2022
6cbea2e
[FIX] cors에러 url 수정
hyeon-z Jul 22, 2022
ddc74b0
[FIX] cors url 변경
hyeon-z Jul 22, 2022
2959331
[CHORE] statucCode 204로 변경
hyeon-z Jul 22, 2022
fa58c34
[CHORE] 삭제한 dayjs 복구
hyeon-z Jul 22, 2022
86bfd55
Merge branch 'develop' into feature/kr
kkl4846 Jul 29, 2022
40c43e6
[FIX] 카카오 로그인 cors 에러
kkl4846 Jul 29, 2022
1017c0a
Merge branch 'feature/kr' into develop
kkl4846 Jul 29, 2022
d451941
[FIX] 카카오 로그인 CORS 에러
kkl4846 Jul 29, 2022
4df5a8d
[DELETE] 보안 상의 이유로 삭제
kkl4846 Jul 29, 2022
4d2d212
[FIX] CORS origin추가
kkl4846 Jul 29, 2022
891dfc8
[FIX] cors에 packman.kr 추가
kkl4846 Jul 29, 2022
77e7e99
[FIX] cors url 수정
hyeon-z Aug 2, 2022
a75fea7
[CHORE] cors 모든 도메인 허용
hyeon-z Aug 8, 2022
13ae5b9
[FIX] cors 모든 도메인 허용
hyeon-z Aug 8, 2022
adf2919
[FIX] cors 모든 도메인 허용
hyeon-z Aug 8, 2022
0ee3927
[CHORE] 토큰 만료 시간 변경
hyeon-z Aug 10, 2022
b3fa5d2
[CHORE] 토큰 만료 시간 변경
hyeon-z Aug 10, 2022
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
28 changes: 27 additions & 1 deletion src/controllers/AlonePackingListPackController.ts
Original file line number Diff line number Diff line change
@@ -74,4 +74,30 @@ const updatePack = async (req: Request, res: Response) => {
}
};

export default { createPack, updatePack };
const deletePack = async (req: Request, res: Response) => {
const { listId, categoryId, packId } = req.params;
try {
const data = await AlonePackingListPackService.deletePack(listId, categoryId, packId);

if (
data === 'no_pack' ||
data === 'no_list' ||
data === 'no_category' ||
data === 'no_list_category' ||
data === 'no_category_pack' ||
data === 'null'
) {
res.status(statusCode.BAD_REQUEST).send(util.fail(statusCode.BAD_REQUEST, message.NO_DATA));
} else {
res
.status(statusCode.OK)
.send(util.success(statusCode.OK, message.DELETE_ALONE_PACK_SUCCESS, data));
}
} catch (error) {
console.log(error);
res
.status(statusCode.INTERNAL_SERVER_ERROR)
.send(util.fail(statusCode.INTERNAL_SERVER_ERROR, message.INTERNAL_SERVER_ERROR));
}
};
export default { createPack, updatePack, deletePack };
1 change: 1 addition & 0 deletions src/routes/AlonePackingListPackRouter.ts
Original file line number Diff line number Diff line change
@@ -24,4 +24,5 @@ router.patch(
AlonePackingListPackController.updatePack,
);

router.delete('/:listId/:categoryId/:packId', auth, AlonePackingListPackController.deletePack);
export default router;
90 changes: 85 additions & 5 deletions src/services/AlonePackingListPackService.ts
Original file line number Diff line number Diff line change
@@ -95,10 +95,7 @@ const updatePack = async (
packRemainNum += 1;
}
}
await AlonePackingList.updateOne(
{ _id: list._id },
{ $set: { packRemainNum: packRemainNum } },
);
await AlonePackingList.updateOne({ _id: list._id }, { $set: { packRemainNum: packRemainNum } });
await Pack.updateOne(
{ _id: packId },
{
@@ -120,7 +117,89 @@ const updatePack = async (
populate: {
path: 'pack',
model: 'Pack',
select: { _id: 1, name: 1, isChecked: 1 },
select: { _id: 1, name: 1, isChecked: 1, packer: 1 },
options: { sort: { createdAt: 1 } },
populate: {
path: 'packer',
model: 'User',
select: {
_id: 1,
name: 1,
},
},
},
});
if (!data) return 'null';
return data;
} catch (error) {
console.log(error);
throw error;
}
};

const deletePack = async (
listId: string,
categoryId: string,
packId: string,
): Promise<AlonePackingListCategoryResponseDto | string> => {
try {
const pack = await Pack.findById(packId);
if (!pack) return 'no_pack';

const cate = await Category.findById(categoryId);
if (!cate) return 'no_category';

const list = await AlonePackingList.findById(listId);
if (!list) return 'no_list';

const stringCate: string[] = [];
const stringPack: string[] = [];

list.category.map((cat) => {
stringCate.push(cat.toString());
});

cate.pack.map((pk) => {
stringPack.push(pk.toString());
});

if (!stringCate.includes(categoryId)) return 'no_list_category';
if (!stringPack.includes(packId)) return 'no_category_pack';

const packs = cate.pack;

const packTotal = list.packTotalNum - 1;
let packRemain = list.packRemainNum;
if (!pack.isChecked) packRemain = list.packRemainNum - 1;

await AlonePackingList.findByIdAndUpdate(listId, {
$set: { packTotalNum: packTotal, packRemainNum: packRemain },
});

await Pack.deleteOne({ _id: packId });
packs.splice(stringPack.indexOf(packId), 1);

await Category.updateOne(
{ _id: categoryId },
{
$set: {
pack: packs,
},
},
);

const data: AlonePackingListCategoryResponseDto | null = await AlonePackingList.findOne(
{ _id: listId },
{ category: 1 },
).populate({
path: 'category',
model: 'Category',
select: { _id: 1, name: 1, pack: 1 },
options: { sort: { createdAt: 1 } },
populate: {
path: 'pack',
model: 'Pack',
select: { _id: 1, name: 1, isChecked: 1, packer: 1 },
options: { sort: { createdAt: 1 } },
populate: {
path: 'packer',
@@ -142,5 +221,6 @@ const updatePack = async (

export default {
createPack,
deletePack,
updatePack,
};