Skip to content
Snippets Groups Projects
Commit 68d87585 authored by Eunhak Lee's avatar Eunhak Lee
Browse files

Merge branch 'fix/share' into 'main'

fix: response 의 구조와 맞지 않는 곳 수정

See merge request !21
parents 772baba4 30bccf1c
Branches main
No related tags found
1 merge request!21fix: response 의 구조와 맞지 않는 곳 수정
Pipeline #10877 passed
...@@ -15,11 +15,15 @@ const ShareRepository = { ...@@ -15,11 +15,15 @@ const ShareRepository = {
const resp = await pool.query( const resp = await pool.query(
`SELECT `SELECT
shares.combination_id, shares.combination_id,
users.nickname,
array(SELECT relations.part_id FROM relations WHERE relations.combination_id = shares.combination_id) as parts, array(SELECT relations.part_id FROM relations WHERE relations.combination_id = shares.combination_id) as parts,
shares.created_at, shares.created_at,
(SELECT created_at FROM combinations WHERE combinations.id = shares.combination_id) as verified_at (SELECT created_at FROM combinations WHERE combinations.id = shares.combination_id) as verified_at
FROM shares FROM shares
WHERE uuid=$1;`, LEFT JOIN combinations ON shares.combination_id = combinations.id
LEFT JOIN users ON combinations.owner_id = users.id
WHERE uuid=$1
;`,
[uniqueId] [uniqueId]
); );
const [row] = resp.rows; const [row] = resp.rows;
......
...@@ -113,9 +113,9 @@ const PartService = { ...@@ -113,9 +113,9 @@ const PartService = {
async getCombinationByUuid(uuid) { async getCombinationByUuid(uuid) {
if (!uuid) throw new ReportableError(400, '올바르지 않은 요청입니다.'); if (!uuid) throw new ReportableError(400, '올바르지 않은 요청입니다.');
const { combination_id, parts, created_at, updated_at } = const { combination_id, nickname, parts, created_at, verified_at } =
await ShareRepository.getCombinationByUuid(uuid); await ShareRepository.getCombinationByUuid(uuid);
return { combination_id, parts, created_at, updated_at }; return { combination_id, nickname, parts, created_at, verified_at };
}, },
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment