feat: Telegram bot, notifications, profile settings, 365-day refresh tokens
This commit is contained in:
@@ -28,11 +28,13 @@ func (h *ProfileHandler) Get(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
user.ProcessForJSON()
|
||||
|
||||
// Return only profile fields
|
||||
profile := map[string]interface{}{
|
||||
"username": user.Username,
|
||||
"telegram_chat_id": user.TelegramChatIDValue,
|
||||
"notifications_enabled": user.NotificationsEnabled,
|
||||
"timezone": user.Timezone,
|
||||
"morning_reminder_time": user.MorningTime,
|
||||
"evening_reminder_time": user.EveningTime,
|
||||
}
|
||||
|
||||
writeJSON(w, profile, http.StatusOK)
|
||||
@@ -63,9 +65,12 @@ func (h *ProfileHandler) Update(w http.ResponseWriter, r *http.Request) {
|
||||
user.ProcessForJSON()
|
||||
|
||||
profile := map[string]interface{}{
|
||||
"username": user.Username,
|
||||
"telegram_chat_id": user.TelegramChatIDValue,
|
||||
"notifications_enabled": user.NotificationsEnabled,
|
||||
"timezone": user.Timezone,
|
||||
"morning_reminder_time": user.MorningTime,
|
||||
"evening_reminder_time": user.EveningTime,
|
||||
}
|
||||
|
||||
writeJSON(w, profile, http.StatusOK)
|
||||
|
||||
Reference in New Issue
Block a user