Skip to content
Closed
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions docs/site/Controller-generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class TodoController {
},
})
async updateAll(
@requestBody() data: Todo,
@requestBody() data: Partial<Todo>,
@param.query.object('where', getWhereSchemaFor(Todo)) where?: Where,
): Promise<number> {
return await this.todoRepository.updateAll(data, where);
Expand All @@ -195,7 +195,7 @@ export class TodoController {
})
async updateById(
@param.path.number('id') id: number,
@requestBody() data: Todo,
@requestBody() data: Partial<Todo>,
): Promise<void> {
await this.todoRepository.updateById(id, data);
}
Expand Down
2 changes: 1 addition & 1 deletion docs/site/todo-list-tutorial-controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export class TodoListController {
})
async updateById(
@param.path.number('id') id: number,
@requestBody() obj: TodoList,
@requestBody() obj: Partial<TodoList>,
): Promise<void> {
await this.todoListRepository.updateById(id, obj);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class TodoListController {
})
async updateById(
@param.path.number('id') id: number,
@requestBody() obj: TodoList,
@requestBody() obj: Partial<TodoList>,
): Promise<void> {
await this.todoListRepository.updateById(id, obj);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/todo-list/src/controllers/todo.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class TodoController {
})
async updateTodo(
@param.path.number('id') id: number,
@requestBody() todo: Todo,
@requestBody() todo: Partial<Todo>,
): Promise<void> {
await this.todoRepo.updateById(id, todo);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/todo/src/controllers/todo.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class TodoController {
})
async updateTodo(
@param.path.number('id') id: number,
@requestBody() todo: Todo,
@requestBody() todo: Partial<Todo>,
): Promise<void> {
await this.todoRepo.updateById(id, todo);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class <%= className %>Controller {
},
})
async updateAll(
@requestBody() <%= modelVariableName %>: <%= modelName %>,
@requestBody() <%= modelVariableName %>: Partial<<%= modelName %>>,
@param.query.object('where', getWhereSchemaFor(<%= modelName %>)) where?: Where,
): Promise<Count> {
return await this.<%= repositoryNameCamel %>.updateAll(<%= modelVariableName %>, where);
Expand All @@ -104,7 +104,7 @@ export class <%= className %>Controller {
})
async updateById(
@param.path.<%= idType %>('id') id: <%= idType %>,
@requestBody() <%= modelVariableName %>: <%= modelName %>,
@requestBody() <%= modelVariableName %>: Partial<<%= modelName %>>,
): Promise<void> {
await this.<%= repositoryNameCamel %>.updateById(id, <%= modelVariableName %>);
}
Expand Down