Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export class TodoController {
@param.body('todo', TodoSchema)
todo: Todo,
): Promise<boolean> {
// REST adapter does not coerce parameter values coming from string sources
// like path & query. As a workaround, we have to cast the value to a number
// ourselves.
// See https://github.com/strongloop/loopback-next/issues/750
id = +id;

return await this.todoRepo.replaceById(id, todo);
}

Expand All @@ -52,6 +58,12 @@ export class TodoController {
@param.body('todo', TodoSchema)
todo: Todo,
): Promise<boolean> {
// REST adapter does not coerce parameter values coming from string sources
// like path & query. As a workaround, we have to cast the value to a number
// ourselves.
// See https://github.com/strongloop/loopback-next/issues/750
id = +id;

return await this.todoRepo.updateById(id, todo);
}

Expand Down