mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29: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
|
// parse requested notifications
|
||||||
var notifications []Notification
|
var notifications []Notification
|
||||||
if err := ParseRequest(r, w, ¬ifications); err != nil {
|
if err := ParseRequest(r, w, ¬ifications); err != nil {
|
||||||
ErrResponse(w, http.StatusBadRequest, err)
|
ErrMsg(err);
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// gernate app token
|
// gernate app token
|
||||||
@ -55,6 +54,7 @@ func AddAccountApp(w http.ResponseWriter, r *http.Request) {
|
|||||||
session.AppVersion = appVersion
|
session.AppVersion = appVersion
|
||||||
session.Platform = platform
|
session.Platform = platform
|
||||||
session.PushToken = deviceToken
|
session.PushToken = deviceToken
|
||||||
|
session.PushEnabled = true
|
||||||
if res := tx.Save(session).Error; res != nil {
|
if res := tx.Save(session).Error; res != nil {
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
@ -34,8 +34,7 @@ func SetAccountAccess(w http.ResponseWriter, r *http.Request) {
|
|||||||
// parse requested notifications
|
// parse requested notifications
|
||||||
var notifications []Notification
|
var notifications []Notification
|
||||||
if err := ParseRequest(r, w, ¬ifications); err != nil {
|
if err := ParseRequest(r, w, ¬ifications); err != nil {
|
||||||
ErrResponse(w, http.StatusBadRequest, err)
|
ErrMsg(err);
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// gernate app token
|
// gernate app token
|
||||||
@ -54,6 +53,7 @@ func SetAccountAccess(w http.ResponseWriter, r *http.Request) {
|
|||||||
AppVersion: appVersion,
|
AppVersion: appVersion,
|
||||||
Platform: platform,
|
Platform: platform,
|
||||||
PushToken: deviceToken,
|
PushToken: deviceToken,
|
||||||
|
PushEnabled: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
// save app and delete token
|
// save app and delete token
|
||||||
|
Loading…
Reference in New Issue
Block a user