From 92cbcb4c1056ff44a81c99d4117904737c2abf94 Mon Sep 17 00:00:00 2001 From: Andrejs Labunskis Date: Thu, 19 Nov 2020 18:01:41 +0200 Subject: [PATCH 1/2] SGO-5 Bugfix: UseAutomations as pointer for false value --- svc_file.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/svc_file.go b/svc_file.go index 4facf3a..941ee24 100644 --- a/svc_file.go +++ b/svc_file.go @@ -50,7 +50,7 @@ type FileUpload struct { CustomTranslationStatusSkippedKeys *bool `json:"custom_translation_status_skipped_keys,omitempty"` Queue bool `json:"queue"` SkipDetectLangIso bool `json:"skip_detect_lang_iso,omitempty"` - UseAutomations bool `json:"use_automations,omitempty"` + UseAutomations *bool `json:"use_automations,omitempty"` } type FileDownload struct { @@ -138,6 +138,9 @@ func (c *FileService) Upload(projectID string, file FileUpload) (r FileUploadRes if file.CustomTranslationStatusInsertedKeys == nil { file.CustomTranslationStatusInsertedKeys = Bool(true) } + if file.UseAutomations == nil { + file.UseAutomations = Bool(true) + } file.Queue = true From 72aec2e57a712b97f2e9acafdbe34bdb5fa912e5 Mon Sep 17 00:00:00 2001 From: Andrejs Labunskis Date: Thu, 19 Nov 2020 18:14:38 +0200 Subject: [PATCH 2/2] SGO-5 File: Upload: Automations: Avoid setting default parameter --- svc_file.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/svc_file.go b/svc_file.go index 941ee24..e32c319 100644 --- a/svc_file.go +++ b/svc_file.go @@ -138,9 +138,6 @@ func (c *FileService) Upload(projectID string, file FileUpload) (r FileUploadRes if file.CustomTranslationStatusInsertedKeys == nil { file.CustomTranslationStatusInsertedKeys = Bool(true) } - if file.UseAutomations == nil { - file.UseAutomations = Bool(true) - } file.Queue = true