Skip to content

Commit

Permalink
Handle empty diff with default argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Greenheart committed Dec 9, 2024
1 parent 20ae8ff commit e99ca46
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/workers/saveToAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const saveToAPI = new DiscordWorker<SaveToApiJob>(
wikidata,
approved,
requiresApproval = true,
diff,
diff = '',
body,
apiSubEndpoint,
} = job.data
Expand All @@ -37,9 +37,7 @@ export const saveToAPI = new DiscordWorker<SaveToApiJob>(
// If approval is required and not yet approved, send approval request
const buttonRow = discord.createButtonRow(job.id!)
await job.sendMessage({
content: `## ${apiSubEndpoint}\n\nNew changes need approval for ${wikidataId}\n\n${
diff || ''
}`,
content: `## ${apiSubEndpoint}\n\nNew changes need approval for ${wikidataId}\n\n${diff}`,
components: [buttonRow],
})

Expand Down

0 comments on commit e99ca46

Please sign in to comment.