Skip to content

Commit

Permalink
Merge pull request #481 from ArtisanCloud/develop
Browse files Browse the repository at this point in the history
fix(Kernel): News Message
  • Loading branch information
Matrix-X committed May 8, 2024
2 parents 856c0d3 + 072d599 commit f0e0320
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/kernel/messages/news.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,13 @@ func (msg *News) OverridePropertiesToArray() {

msg.PropertiesToArray = func(data *object.HashMap, aliases *object.HashMap) (*object.HashMap, error) {
arrayItems := msg.Get("items", nil).([]*object.HashMap)
//title := msg.Get("title", nil).(string)
//description := msg.Get("description", nil).(string)
//picUrl := msg.Get("picUrl", nil).(string)
//url := msg.Get("url", nil).(string)
arrayMapItems := []*object.HashMap{}
for _, item := range arrayItems {
arrayMapItems = append(arrayMapItems, item)
}

return &object.HashMap{
"articles": arrayMapItems,
//"title": title,
//"description": description,
//"picUrl": picUrl,
//"url": url,
}, nil
}

Expand All @@ -50,10 +42,6 @@ func (msg *News) OverrideToXmlArray() {
items := []*object.HashMap{}

getItem := msg.Get("items", nil)
//title := msg.Get("title", nil).(string)
//description := msg.Get("description", nil).(string)
//picUrl := msg.Get("picUrl", nil).(string)
//url := msg.Get("url", nil).(string)
if getItem != nil {
arrayItems := getItem.([]*object.HashMap)
for _, item := range arrayItems {
Expand All @@ -67,10 +55,6 @@ func (msg *News) OverrideToXmlArray() {
return &object.HashMap{
"ArticleCount": len(items),
"Articles": items,
//"Title": title,
//"Description": description,
//"PicUrl": picUrl,
//"Url": url,
}
}
}

0 comments on commit f0e0320

Please sign in to comment.