Merge pull request #4 from Selly-Modules/save-audit-msg

save author type to specify role of user
This commit is contained in:
Sinh Luu 2022-06-29 17:08:50 +07:00 committed by GitHub
commit f63f126227
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -21,6 +21,7 @@ type CreatePayload struct {
type CreatePayloadAuthor struct {
ID string
Name string
Type string
}
// Create ...
@ -37,6 +38,7 @@ func (s Service) Create(payload CreatePayload) {
Author: Author{
ID: payload.Author.ID,
Name: payload.Author.Name,
Type: payload.Author.Type,
},
CreatedAt: now(),
Message: payload.Message,

View File

@ -22,4 +22,5 @@ type Audit struct {
type Author struct {
ID string `bson:"id" json:"id"`
Name string `bson:"name" json:"name"`
Type string `bson:"type" json:"type"`
}