Skip to content

Commit cc9523f

Browse files
committed
fix(search): changed empty state response
1 parent 794e810 commit cc9523f

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/search/search.controller.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
Get,
55
Header,
66
Headers,
7-
NotFoundException,
87
Query,
98
UseGuards,
109
ValidationPipe,
@@ -88,12 +87,7 @@ export class SearchController {
8887
if (address) {
8988
await this.profileService.logSearchInteraction(address, query);
9089
}
91-
const result = await this.searchService.searchPillar(params, community);
92-
if (result.success) {
93-
return result;
94-
} else {
95-
throw new NotFoundException(result);
96-
}
90+
return this.searchService.searchPillar(params, community);
9791
}
9892

9993
@Get("pillar/items")

src/search/search.service.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,8 +1149,9 @@ export class SearchService {
11491149
};
11501150
} else {
11511151
return {
1152-
success: false,
1152+
success: true,
11531153
message: "Pillar not found",
1154+
data: null,
11541155
};
11551156
}
11561157
} catch (err) {
@@ -1253,8 +1254,9 @@ export class SearchService {
12531254
}
12541255
} else {
12551256
return {
1256-
success: false,
1257+
success: true,
12571258
message: "Pillar not found",
1259+
data: null,
12581260
};
12591261
}
12601262
} catch (err) {
@@ -1509,8 +1511,9 @@ export class SearchService {
15091511
};
15101512
} else {
15111513
return {
1512-
success: false,
1514+
success: true,
15131515
message: "Filter config not found",
1516+
data: null,
15141517
};
15151518
}
15161519
} catch (err) {

0 commit comments

Comments
 (0)