Skip to content

Commit

Permalink
perf(category): friendly notice when merging with an error type
Browse files Browse the repository at this point in the history
  • Loading branch information
wibus-wee committed Aug 10, 2022
1 parent f085956 commit eb454bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/modules/category/category.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,14 @@ export class CategoryController {
if (body.from === body.to) {
throw new BadRequestException("from and to are same");
}
if (body.type === CategoryType.Tag) {
if (body.type == CategoryType.Tag) {
// 合并标签
await this.categoryService.mergeTag(body.from, body.to);
} else if (body.type === CategoryType.Category) {
} else if (body.type == CategoryType.Category) {
// 合并分类
await this.categoryService.mergeCategory(body.from, body.to);
} else {
throw new BadRequestException("type is invalid");
}
return { message: "success" };
}
Expand Down

0 comments on commit eb454bf

Please sign in to comment.