mirror of
https://github.com/balzack/databag.git
synced 2025-02-11 19:19:16 +00:00
making notifications optional
This commit is contained in:
parent
45e002a97c
commit
53f947d675
@ -26,8 +26,7 @@ func AddAccountApp(w http.ResponseWriter, r *http.Request) {
|
||||
// parse requested notifications
|
||||
var notifications []Notification
|
||||
if err := ParseRequest(r, w, ¬ifications); err != nil {
|
||||
ErrResponse(w, http.StatusBadRequest, err)
|
||||
return
|
||||
ErrMsg(err);
|
||||
}
|
||||
|
||||
// gernate app token
|
||||
@ -55,6 +54,7 @@ func AddAccountApp(w http.ResponseWriter, r *http.Request) {
|
||||
session.AppVersion = appVersion
|
||||
session.Platform = platform
|
||||
session.PushToken = deviceToken
|
||||
session.PushEnabled = true
|
||||
if res := tx.Save(session).Error; res != nil {
|
||||
return res
|
||||
}
|
||||
|
@ -34,8 +34,7 @@ func SetAccountAccess(w http.ResponseWriter, r *http.Request) {
|
||||
// parse requested notifications
|
||||
var notifications []Notification
|
||||
if err := ParseRequest(r, w, ¬ifications); err != nil {
|
||||
ErrResponse(w, http.StatusBadRequest, err)
|
||||
return
|
||||
ErrMsg(err);
|
||||
}
|
||||
|
||||
// gernate app token
|
||||
@ -54,6 +53,7 @@ func SetAccountAccess(w http.ResponseWriter, r *http.Request) {
|
||||
AppVersion: appVersion,
|
||||
Platform: platform,
|
||||
PushToken: deviceToken,
|
||||
PushEnabled: true,
|
||||
}
|
||||
|
||||
// save app and delete token
|
||||
|
Loading…
Reference in New Issue
Block a user