mirror of
http://ghproxy.cn/https://github.com/multunus/onemdm-server
synced 2025-12-06 10:14:59 +00:00
Change the registration API to return next heartbeat time
This commit is contained in:
@@ -6,7 +6,10 @@ class DevicesController < ApplicationController
|
||||
device = Device.find_or_initialize_by(unique_id: device_params[:unique_id])
|
||||
device.assign_attributes(device_params)
|
||||
if device.save
|
||||
render json: { access_token: device.access_token }, status: :created
|
||||
render json: { access_token: device.access_token,
|
||||
next_heartbeat_time: device.next_heartbeat_time
|
||||
},
|
||||
status: :created
|
||||
else
|
||||
render json: { error: device.errors.full_messages }, status: :unprocessable_entity
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user