Skip to content

Commit db38e78

Browse files
committed
fix: use draftId field from gog response instead of id
gog gmail drafts create/update returns { draftId } not { id }. Using .id caused undefined draftId, making drafts send fail with 404.
1 parent 9b3e3cb commit db38e78

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/server/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ async function createOrUpdateGmailDraft(email: GmailReviewEmail, editedDraft: Re
153153
const replyToArgs = email.gmailMessageId ? ['--reply-to-message-id', email.gmailMessageId] : []
154154

155155
if (email.gmailDraftId) {
156-
const updated = await runGogJson<{ id: string }>([
156+
const updated = await runGogJson<{ draftId: string }>([
157157
'gmail', 'drafts', 'update', email.gmailDraftId,
158158
'--subject', subject,
159159
'--to', to,
@@ -165,10 +165,10 @@ async function createOrUpdateGmailDraft(email: GmailReviewEmail, editedDraft: Re
165165
'--results-only',
166166
'--no-input',
167167
])
168-
return updated.id
168+
return updated.draftId
169169
}
170170

171-
const created = await runGogJson<{ id: string }>([
171+
const created = await runGogJson<{ draftId: string }>([
172172
'gmail', 'drafts', 'create',
173173
'--subject', subject,
174174
'--to', to,
@@ -180,7 +180,7 @@ async function createOrUpdateGmailDraft(email: GmailReviewEmail, editedDraft: Re
180180
'--results-only',
181181
'--no-input',
182182
])
183-
return created.id
183+
return created.draftId
184184
}
185185

186186
async function syncMarkedRead(threadIds: string[]): Promise<void> {

0 commit comments

Comments
 (0)