Compare commits
No commits in common. "1ce4fd93b940627496783b537ba63e388648a615" and "7eb498ff389e53a0393dbd37dec045585f4449d8" have entirely different histories.
1ce4fd93b9
...
7eb498ff38
@ -35,22 +35,22 @@ func NewGetDMailsBuilder(requestContext model.RequestContext) DMailsBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (g getDMails) ByTitle(title string) DMailsBuilder {
|
func (g getDMails) ByTitle(title string) DMailsBuilder {
|
||||||
g.query["search[title_matches]"] = title
|
g.query["title_matches"] = title
|
||||||
return g
|
return g
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g getDMails) ByBody(body string) DMailsBuilder {
|
func (g getDMails) ByBody(body string) DMailsBuilder {
|
||||||
g.query["search[message_matches]"] = body
|
g.query["message_matches"] = body
|
||||||
return g
|
return g
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g getDMails) ByToName(toName string) DMailsBuilder {
|
func (g getDMails) ByToName(toName string) DMailsBuilder {
|
||||||
g.query["search[to_name]"] = toName
|
g.query["to_name"] = toName
|
||||||
return g
|
return g
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g getDMails) ByFromName(fromName string) DMailsBuilder {
|
func (g getDMails) ByFromName(fromName string) DMailsBuilder {
|
||||||
g.query["search[from_name]"] = fromName
|
g.query["from_name"] = fromName
|
||||||
return g
|
return g
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ func GetAllDmails(requestContext model.RequestContext, query map[string]string)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
// Log the error and return an empty slice and the error.
|
// Log the error and return an empty slice and the error.
|
||||||
|
|
||||||
return []model.DMail{}, nil
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the list of posts and no error (nil).
|
// Return the list of posts and no error (nil).
|
||||||
|
Reference in New Issue
Block a user