I should put it this way, the `jsonTodo` is the da...
# android
e
I should put it this way, the
jsonTodo
is the data you need to write, together with the
id
, instead of removing it from the call site, what you should do it adding that to the function signature so that the function can receive both information you need.
n
How can I do this?
@rkeazor
Do u knw
e
Change your
.editTodo
function
n
How
e
I think this is even the most basic stuff in programming, you shouldn't need to ask
n
@rkeazor here a thread bro
r
I agree with @edwardwongtl , you should take time and learn some core coding concepts and fundamentals
In the long run, it will be more beneficial
Granted there are some issues you can run into that will be overly complex and down right confusing😂. So its defiantly cool to ask . But things like parameter signatures are core principal
n
@Vishal hi
to this:
interface APIService { @POST(Constants.GET_TODO_LIST) fun getToDoList(): Observable<GetToDoListAPIResponse> @POST(Constants.EDIT_TODO) fun editTodo( @Field("todo_id") todoID:String, @Body todo_id:String, @Field("todo") todo:String 😞 Observable<BaseAPIResponse> @POST(Constants.ADD_TODO) fun addTodo(@Body todo:String): Observable<BaseAPIResponse> }
but not solved
e
Any error message to give more information?
n
I willtell
v
Please send logcat message
n
C\neuber\adt bundle windows x86 64 20140702\sdk\ToDoApplication\app\src\main\java\com\rivuchk\todoapplication\tododetails\TodoDetailsActivity.kt (66, 70): No value passed for parameter 'todo'
e
No value passed for parameter 'todo'
The error message already told you the issue.
n
I can't solved
I tried
!
e
You need to pass something for the
todo
parameter at the call site
n
look this:
.editTodo(todoID: todoDataModel?.id?.toString()?:"",jsonTodo )
todoID is automatically populated because of this:
@POST(Constants.EDIT_TODO) fun editTodo( @Field("todo_id") todoID:String, @Body todo_id:String, @Field("todo") todo:String ):Observable<BaseAPIResponse>
todoID is first
Understood?
e
Your
.editTodo()
now takes 3 parameters, and you're passing two
n
3
how can I pass the todo parameter in this case?
e
Just check the parameter's order and you should know
Look man, I cannot answer this kind of basic programming question forever, this is the basics of the basics in programming, not specifically about Android but in general for any king of programming.
n
@kagomez