Skip to content

Commit

Permalink
Merge pull request #7 from tukaelu/refactor/remove-unnecessaries
Browse files Browse the repository at this point in the history
Refactor/remove unnecessaries
  • Loading branch information
tukaelu authored Aug 1, 2024
2 parents fc81377 + dc0f916 commit f55e358
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 25 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ outdated: false
section_id: 1234567890
source_id: 12345678901234
html_url: https://{your help center domain}/hc/ja/articles/12345678901234
created_at: "2024-01-01T00:00:00Z"
updated_at: "2024-01-01T00:00:00Z"
---
## Markdown

Expand Down
23 changes: 2 additions & 21 deletions internal/cli/cmdPush.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,10 @@ func (c *CommandPush) pushArticle(g *Global, file string) error {
locale = a.Locale
}

res, err := c.client.UpdateArticle(locale, a.ID, payload)
_, err = c.client.UpdateArticle(locale, a.ID, payload)
if err != nil {
return err
}
if err = a.FromJson(res); err != nil {
return err
}

if err = a.Save(file, false); err != nil {
return err
}

return nil
}
Expand All @@ -97,8 +90,6 @@ func (c *CommandPush) pushTranslation(g *Global, file string) error {
return err
}

origBody := t.Body

if !c.Raw {
if t.Body, err = c.converter.ConvertToHTML(t.Body); err != nil {
return err
Expand All @@ -122,20 +113,10 @@ func (c *CommandPush) pushTranslation(g *Global, file string) error {
locale = t.Locale
}

res, err := c.client.UpdateTranslation(t.SourceID, locale, payload)
_, err = c.client.UpdateTranslation(t.SourceID, locale, payload)
if err != nil {
return err
}
if err = t.FromJson(res); err != nil {
return err
}

if !c.Raw {
t.Body = origBody
}
if err = t.Save(file, false); err != nil {
return err
}

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions internal/zendesk/translation.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ type Translation struct {
SectionID int `json:"-" yaml:"section_id,omitempty"`
SourceID int `json:"source_id,omitempty" yaml:"source_id"`
HtmlURL string `json:"html_url,omitempty" yaml:"html_url"`
CreatedAt string `json:"created_at,omitempty" yaml:"created_at"`
UpdatedAt string `json:"updated_at,omitempty" yaml:"updated_at"`
CreatedAt string `json:"created_at,omitempty" yaml:"-"`
UpdatedAt string `json:"updated_at,omitempty" yaml:"-"`
ID int `json:"id" yaml:"-"`
URL string `json:"url,omitempty" yaml:"-"`
SourceType string `json:"source_type,omitempty" yaml:"-"`
Expand Down

0 comments on commit f55e358

Please sign in to comment.