From c21049f6281fd04a997300e4f142466410983873 Mon Sep 17 00:00:00 2001 From: EungGu Yun Date: Wed, 11 Dec 2019 23:55:17 +0900 Subject: [PATCH] Add seller contract button --- src/backend/handlers/user.js | 6 +++++- src/backend/responses/item.js | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/backend/handlers/user.js b/src/backend/handlers/user.js index 951d885..92ebda2 100644 --- a/src/backend/handlers/user.js +++ b/src/backend/handlers/user.js @@ -104,7 +104,11 @@ const report = async (event) => { }; const contract = async (event) => { - const userId = parser.getUserId(event); + var userId = parser.getUserId(event); + const extras = parser.getExtras(event); + if ("targetUserId" in extras) { + userId = extras["targetUserId"]; + } const contracts = await database.getTransaction(userId); if (contracts == null) { diff --git a/src/backend/responses/item.js b/src/backend/responses/item.js index 710421c..c7df537 100644 --- a/src/backend/responses/item.js +++ b/src/backend/responses/item.js @@ -91,6 +91,7 @@ module.exports.itemDetail = (item, mode="list") => { if(item.openprofile) { resultButtons.push(builder.getButton("판매자 연결", "webLink", item.openprofile)); } + resultButtons.push(builder.getButton("판매자 거래기록", "block", "판매자 거래기록", resource.userInfoContractListBlockId, {targetUserId: item.userId})); resultButtons.push(builder.getButton("신고", "block", "신고", resource.userReportBlockId, {targetUserId: item.userId, targetNickname: item.nickname})); } bodys.push(builder.getBasicCardBody(resultTitle, resultDescription, "", resultButtons));