Skip to content
Snippets Groups Projects
Verified Commit 586827e0 authored by Eunhak Lee's avatar Eunhak Lee
Browse files

feat: uuid로 인증 조합 가져오기

parent bf7d3007
No related branches found
No related tags found
1 merge request!20내 PC를 인증된 조합으로 공유하기 기능
...@@ -52,4 +52,13 @@ partRouter.get( ...@@ -52,4 +52,13 @@ partRouter.get(
}) })
); );
partRouter.get(
'/combination/by-uuid/:uuid',
wrapAsync(async (req, res) => {
const { uuid } = req.params;
const info = await PartService.getCombinationByUuid(uuid);
return res.sendResponse('', 200, { ...info });
})
);
export default partRouter; export default partRouter;
import { columnMapping } from '../constants/columnMapping.js'; import { columnMapping } from '../constants/columnMapping.js';
import { ReportableError } from '../errors.js'; import { ReportableError } from '../errors.js';
import PartRepository from '../repositories/partRepository.js'; import PartRepository from '../repositories/partRepository.js';
import ShareRepository from '../repositories/shareRepository.js';
const PartService = { const PartService = {
cleanEntity(entity) { cleanEntity(entity) {
...@@ -108,6 +109,14 @@ const PartService = { ...@@ -108,6 +109,14 @@ const PartService = {
partIds: combination.partids, partIds: combination.partids,
})); }));
}, },
async getCombinationByUuid(uuid) {
if (!uuid) throw new ReportableError(400, '올바르지 않은 요청입니다.');
const { combination_id, parts, created_at, updated_at } =
await ShareRepository.getCombinationByUuid(uuid);
return { combination_id, parts, created_at, updated_at };
},
}; };
export default PartService; export default PartService;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment