mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
refactor(api): Refactor updateOne logic
This commit is contained in:
@@ -165,7 +165,10 @@ export class MenuController extends BaseController<
|
||||
*/
|
||||
@CsrfCheck(true)
|
||||
@Patch(':id')
|
||||
async updateOne(@Body() body: MenuCreateDto, @Param('id') id: string) {
|
||||
async updateOne(
|
||||
@Body() body: MenuCreateDto,
|
||||
@Param('id') id: string,
|
||||
): Promise<Menu> {
|
||||
if (!id) return await this.create(body);
|
||||
return await this.menuService.updateOne(id, body);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user