feat: API Endpoints to update message status (#11387)
- Added an api endpoint for update message status ( available only for api inboxes ) - Moved message status management to a service. - Handles case where read status arrive before delivered fixes: #10314 , #9962
This commit is contained in:
@@ -14,10 +14,10 @@ class Line::SendOnLineService < Base::SendOnChannelService
|
||||
|
||||
if response.code == '200'
|
||||
# If the request is successful, update the message status to delivered
|
||||
message.update!(status: :delivered)
|
||||
Messages::StatusUpdateService.new(message, 'delivered').perform
|
||||
else
|
||||
# If the request is not successful, update the message status to failed and save the external error
|
||||
message.update!(status: :failed, external_error: external_error(parsed_json))
|
||||
Messages::StatusUpdateService.new(message, 'failed', external_error(parsed_json)).perform
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user