app/controllers/task_manager/api/v1/plans_controller.rb in task-manager-0.1.2 vs app/controllers/task_manager/api/v1/plans_controller.rb in task-manager-0.1.3
- old
+ new
@@ -45,11 +45,11 @@
# "name": ...
# }, ...]
# }, ...]
# }
def index
- plans = TaskManager::Plan.search(params[:q]).result
+ plans = TaskManager::Plan.search(params[:q]).result.order('id DESC')
result = {
total: plans.count,
plans: ActiveModel::ArraySerializer.new(
plans.page(params[:page]).per(params[:limit])
).as_json
@@ -82,11 +82,11 @@
# # 否则,为null
# "deadline_hour": ..., # 必填
# "deadline_minute": ... # 必填
# },
# "enabled_at": ..., # 必填
- # "begin_to_remind": ..., # 必填且小于等于0
+ # "begin_to_remind": ..., # 必填且大于等于0
# "autocompletable": ..., # 必填,缺省值为false
# "assignables_attributes": [{ # 至少需要一个assignable
# "assignee_id": ...,
# "assignee_type": ...
# }, ...],
@@ -160,10 +160,10 @@
# # 否则,为null
# "deadline_hour": ..., # 必填
# "deadline_minute": ... # 必填
# },
# "enabled_at": ..., # 必填
- # "begin_to_remind": ..., # 必填且小于等于0
+ # "begin_to_remind": ..., # 必填且大于等于0
# "autocompletable": ..., # 必填,缺省值为false
#
# "assignables_attributes": [{
# "id": ..., ## 可选,
# ## 如果有,则更新,否则创建