mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 16:20:12 +01:00
add new_todo API call that specifies project_id, too
Signed-off-by: Reinier Balt <lrbalt@gmail.com>
This commit is contained in:
parent
b1256ab6e9
commit
6b8043d656
2 changed files with 11 additions and 0 deletions
|
|
@ -3,6 +3,10 @@ class TodoApi < ActionWebService::API::Base
|
||||||
:expects => [{:username => :string}, {:token => :string}, {:context_id => :int}, {:description => :string}, {:notes => :string}],
|
:expects => [{:username => :string}, {:token => :string}, {:context_id => :int}, {:description => :string}, {:notes => :string}],
|
||||||
:returns => [:int]
|
:returns => [:int]
|
||||||
|
|
||||||
|
api_method :new_todo_for_project,
|
||||||
|
:expects => [{:username => :string}, {:token => :string}, {:context_id => :int}, {:project_id => :int}, {:description => :string}, {:notes => :string}],
|
||||||
|
:returns => [:int]
|
||||||
|
|
||||||
api_method :new_rich_todo,
|
api_method :new_rich_todo,
|
||||||
:expects => [{:username => :string}, {:token => :string}, {:default_context_id => :int}, {:description => :string}, {:notes => :string}],
|
:expects => [{:username => :string}, {:token => :string}, {:default_context_id => :int}, {:description => :string}, {:notes => :string}],
|
||||||
:returns => [:int]
|
:returns => [:int]
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,13 @@ class BackendController < ApplicationController
|
||||||
item.id
|
item.id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def new_todo_for_project(username, token, context_id, project_id, description, notes)
|
||||||
|
check_token(username, token)
|
||||||
|
check_context_belongs_to_user(context_id)
|
||||||
|
item = create_todo(description, context_id, project_id, notes)
|
||||||
|
item.id
|
||||||
|
end
|
||||||
|
|
||||||
def new_rich_todo(username, token, default_context_id, description, notes)
|
def new_rich_todo(username, token, default_context_id, description, notes)
|
||||||
check_token(username,token)
|
check_token(username,token)
|
||||||
item = Todo.from_rich_message(@user, default_context_id, description, notes)
|
item = Todo.from_rich_message(@user, default_context_id, description, notes)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue