Skip to content

Commit

Permalink
Feat: Add create/modified by to article (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreychuk authored Oct 17, 2016
1 parent 77d9ea5 commit 4cb65b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ func main() {
routes := routes.CreateRoutes()
router := router.NewHatchRouter(routes)
loggerRouter := handlers.CombinedLoggingHandler(os.Stdout, router)

http.ListenAndServe(":3810", loggerRouter)
}
5 changes: 5 additions & 0 deletions store/articles.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type Article struct {
Attachments []Attachment `bson:"attachments"json:"attachments"validate:"omitempty"`
CustomFields []CustomFields `bson:"customFields"json:"customFields"validate:"omitempty"`
PCC []string `bson:"pcc"json:"pcc"validate:"omitempty"`
CreatedBy string `bson:"createdBy"json:"createdBy"validate:"omitempty"`
ModifiedBy string `bson:"modifiedBy"json:"modifiedBy"validate:"omitempty"`
}

//Attachment store link and file name
Expand Down Expand Up @@ -123,6 +125,9 @@ func (art *ArticlesCollection) Update(ID bson.ObjectId, entry Article) (err erro
"tags": entry.Tags,
"attachments": entry.Attachments,
"customFields": entry.CustomFields,
"pcc": entry.PCC,
"createdBy": entry.CreatedBy,
"modifiedBy": entry.ModifiedBy,
},
}

Expand Down

0 comments on commit 4cb65b7

Please sign in to comment.