fix add facebook page flow
This commit is contained in:
parent
703ffe34b2
commit
b6aba699c9
@ -38,6 +38,9 @@ func GetFacebookPageByID(id string) (page *FacebookPageModel, err error) {
|
||||
if err != nil && err != sql.ErrNoRows {
|
||||
return
|
||||
}
|
||||
if err == sql.ErrNoRows {
|
||||
page = nil
|
||||
}
|
||||
return page, nil
|
||||
}
|
||||
|
||||
|
@ -85,6 +85,16 @@ func addFacebookPage(info EvtInfo, fbid, tmpl string) string {
|
||||
if err != nil {
|
||||
return "write data fail"
|
||||
}
|
||||
rt, err := dsmodel.CreateFacebookRT(info.Channel, page.ID, tmpl)
|
||||
if err != nil {
|
||||
log.Println("create fail :: ", err)
|
||||
return "create data fail"
|
||||
}
|
||||
|
||||
err = rt.Write()
|
||||
if err != nil {
|
||||
return "write data fail"
|
||||
}
|
||||
} else {
|
||||
fbrt, err := ch.GetFacebookPageByID(fbid)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user