refactor: change return type of remove funcs
This commit is contained in:
@@ -49,7 +49,7 @@ export class WorkspaceTypeController {
|
|||||||
@ApiParam({ name: "id", description: "WorkspaceType ID" })
|
@ApiParam({ name: "id", description: "WorkspaceType ID" })
|
||||||
@ApiResponse({ status: 200, description: "WorkspaceType deleted" })
|
@ApiResponse({ status: 200, description: "WorkspaceType deleted" })
|
||||||
@ApiResponse({ status: 404, description: "WorkspaceType not found" })
|
@ApiResponse({ status: 404, description: "WorkspaceType not found" })
|
||||||
remove(@Param("id") id: string): Promise<void> {
|
remove(@Param("id") id: string): Promise<TMWorkspaceType> {
|
||||||
return this.workspaceTypeService.remove(id);
|
return this.workspaceTypeService.remove(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export class WorkspaceController {
|
|||||||
@ApiParam({ name: 'id', description: 'Workspace ID' })
|
@ApiParam({ name: 'id', description: 'Workspace ID' })
|
||||||
@ApiResponse({ status: 200, description: 'Workspace deleted' })
|
@ApiResponse({ status: 200, description: 'Workspace deleted' })
|
||||||
@ApiResponse({ status: 404, description: 'Workspace not found' })
|
@ApiResponse({ status: 404, description: 'Workspace not found' })
|
||||||
remove(@Param('id') id: string): Promise<void> {
|
remove(@Param('id') id: string): Promise<TMWorkspace> {
|
||||||
return this.workspaceService.remove(id);
|
return this.workspaceService.remove(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -44,8 +44,10 @@ export class WorkspaceTypeService {
|
|||||||
return this.findOne(id);
|
return this.findOne(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
async remove(id: string): Promise<void> {
|
async remove(id: string): Promise<TMWorkspaceType> {
|
||||||
await this.findOne(id);
|
const workspaceType = await this.findOne(id);
|
||||||
await this.workspaceTypeRepository.delete(id);
|
await this.workspaceTypeRepository.delete(id);
|
||||||
|
|
||||||
|
return workspaceType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,8 +57,10 @@ export class WorkspaceService {
|
|||||||
return this.workspaceRepository.save(workspace);
|
return this.workspaceRepository.save(workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
async remove(id: string): Promise<void> {
|
async remove(id: string): Promise<TMWorkspace> {
|
||||||
await this.findOneOrFail(id);
|
const workspace = await this.findOneOrFail(id);
|
||||||
await this.workspaceRepository.delete(id);
|
await this.workspaceRepository.delete(id);
|
||||||
|
|
||||||
|
return workspace;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user