save author type to specify role of user #4
|
@ -21,6 +21,7 @@ type CreatePayload struct {
|
||||||
type CreatePayloadAuthor struct {
|
type CreatePayloadAuthor struct {
|
||||||
ID string
|
ID string
|
||||||
Name string
|
Name string
|
||||||
|
Type string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create ...
|
// Create ...
|
||||||
|
@ -37,6 +38,7 @@ func (s Service) Create(payload CreatePayload) {
|
||||||
Author: Author{
|
Author: Author{
|
||||||
ID: payload.Author.ID,
|
ID: payload.Author.ID,
|
||||||
Name: payload.Author.Name,
|
Name: payload.Author.Name,
|
||||||
|
Type: payload.Author.Type,
|
||||||
},
|
},
|
||||||
CreatedAt: now(),
|
CreatedAt: now(),
|
||||||
Message: payload.Message,
|
Message: payload.Message,
|
||||||
|
|
|
@ -22,4 +22,5 @@ type Audit struct {
|
||||||
type Author struct {
|
type Author struct {
|
||||||
ID string `bson:"id" json:"id"`
|
ID string `bson:"id" json:"id"`
|
||||||
Name string `bson:"name" json:"name"`
|
Name string `bson:"name" json:"name"`
|
||||||
|
Type string `bson:"type" json:"type"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue