UBER-289: Prevent empty changes to go into transactions. (#3277)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2023-05-29 17:47:45 +07:00 committed by GitHub
parent eae0107d28
commit 6b7e83ce8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -106,7 +106,7 @@
const updates: Partial<Data<Vacancy>> = {}
const trimmedName = rawName.trim()
if (trimmedName.length > 0 && trimmedName !== object.name) {
if (trimmedName.length > 0 && trimmedName !== object.name?.trim()) {
updates.name = trimmedName
}

View File

@ -108,7 +108,7 @@
const trimmedTitle = title.trim()
if (trimmedTitle.length > 0 && trimmedTitle !== issue.title) {
if (trimmedTitle.length > 0 && trimmedTitle !== issue.title?.trim()) {
await client.update(issue, { title: trimmedTitle })
}
}

View File

@ -97,7 +97,7 @@
const trimmedTitle = title.trim()
if (trimmedTitle.length > 0 && trimmedTitle !== template.title) {
if (trimmedTitle.length > 0 && trimmedTitle !== template.title?.trim()) {
await client.update(template, { title: trimmedTitle })
}
}