feat: Update last_snoozed_at after the un-snooze notification (#8943)

This commit is contained in:
Muhsin Keloth
2024-02-20 18:55:39 +05:30
committed by GitHub
parent c5c0845151
commit e6cf8c39b7
6 changed files with 27 additions and 5 deletions

View File

@@ -54,7 +54,8 @@ class Api::V1::Accounts::NotificationsController < Api::V1::Accounts::BaseContro
end
def snooze
@notification.update(snoozed_until: parse_date_time(params[:snoozed_until].to_s)) if params[:snoozed_until]
updated_meta = (@notification.meta || {}).merge('last_snoozed_at' => nil)
@notification.update(snoozed_until: parse_date_time(params[:snoozed_until].to_s), meta: updated_meta) if params[:snoozed_until]
render json: @notification
end