From 8acb7fdd450ea3038e87f9594d380ef210309303 Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 2 May 2022 17:38:34 +0800 Subject: [PATCH] fix: remove comment location duplicated name --- src/modules/comment/comment.controller.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/comment/comment.controller.ts b/src/modules/comment/comment.controller.ts index 2597c142..c8bf468f 100644 --- a/src/modules/comment/comment.controller.ts +++ b/src/modules/comment/comment.controller.ts @@ -134,7 +134,9 @@ export class CommentController { .then( (res) => `${res.cityName ? `${res.cityName}` : ''}${ - res.regionName ? `-${res.regionName}` : '' + res.regionName && res.regionName !== res.cityName + ? `-${res.regionName}` + : '' }` || undefined, ) .catch(() => undefined)