making notifications optional

This commit is contained in:
Roland Osborne 2022-11-15 09:10:01 -08:00
parent 45e002a97c
commit 53f947d675
2 changed files with 4 additions and 4 deletions

View File

@ -26,8 +26,7 @@ func AddAccountApp(w http.ResponseWriter, r *http.Request) {
// parse requested notifications
var notifications []Notification
if err := ParseRequest(r, w, &notifications); 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
}

View File

@ -34,8 +34,7 @@ func SetAccountAccess(w http.ResponseWriter, r *http.Request) {
// parse requested notifications
var notifications []Notification
if err := ParseRequest(r, w, &notifications); 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