From b0b5a99e055e3f106052172a238a7f4b05f9d567 Mon Sep 17 00:00:00 2001 From: Wei18 <41205mw@gmail.com> Date: Mon, 9 Sep 2024 01:20:07 +0800 Subject: [PATCH] More log to represent inputs. --- Sources/CommentCore/CommentUseCase.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/CommentCore/CommentUseCase.swift b/Sources/CommentCore/CommentUseCase.swift index 44a22f0..b8be4d4 100644 --- a/Sources/CommentCore/CommentUseCase.swift +++ b/Sources/CommentCore/CommentUseCase.swift @@ -77,17 +77,17 @@ struct CommentUseCase { // Try to find an existing comment with the hidden anchor content. if let comment = comments.first(where: { $0.body?.contains(hidingContent) == true }) { - print("Update the existing comment with the new body content.") _ = try await client.issues_sol_update_hyphen_comment( path: .init(owner: owner, repo: repo, comment_id: Components.Parameters.comment_hyphen_id(comment.id)), body: .json(.init(body: newBody)) - ) + ).ok + print("Update the existing comment with the new body content.") } else { - print("Create a new comment if no existing comment with the anchor is found.") _ = try await client.issues_sol_create_hyphen_comment( path: .init(owner: owner, repo: repo, issue_number: number), body: .json(.init(body: newBody)) - ) + ).created + print("Create a new comment which no existing comment with the anchor is found.") } } }