cc-core-cli 1.0.120 → 1.0.121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-core-cli",
3
- "version": "1.0.120",
3
+ "version": "1.0.121",
4
4
  "description": "Command Line Interface tool for generating project templates for the (Your Platform's Name) platform.",
5
5
  "main": "bin/index.js",
6
6
  "scripts": {
@@ -154,20 +154,26 @@ export class CoreController {
154
154
  @Param() params: any,
155
155
  @Query() query: any
156
156
  ): Promise<any> {
157
+ const { keywords, filters, page, page_size, sort, grouping } = query;
158
+ const searchKey = `${keywords || ""}${
159
+ _.isEmpty(filters) ? "" : JSON.stringify(filters)
160
+ }${page || ""}${page_size || ""}${sort || ""}${grouping || ""}`;
157
161
  if (
158
162
  !["mail_setting"].includes(params.entity) &&
159
163
  params.entity.indexOf("_setting") !== -1
160
164
  ) {
161
165
  return this.serviceSetting.getSetting(params.entity, params.key);
162
166
  } else {
163
- if (/^(?=[a-f\d]{24}$)(\d+[a-f]|[a-f]+\d)/i.test(params.key)) {
167
+ if (
168
+ /^(?=[a-f\d]{24}$)(\d+[a-f]|[a-f]+\d)/i.test(params.key) ||
169
+ _.isEmpty(searchKey)
170
+ ) {
164
171
  return this.service.findOne(
165
172
  params.entity,
166
173
  params.key,
167
174
  this._convertFields(query.fields)
168
175
  );
169
176
  }
170
- const { keywords, filters, page, page_size, sort, grouping } = query;
171
177
  return this.service.searchWithLayout(
172
178
  params.entity,
173
179
  params.key,
@@ -255,7 +255,6 @@ async function bootstrap() {
255
255
 
256
256
  // Serve specific file for "/"
257
257
  fastify.get("/", (request, reply) => {
258
- console.log("Serving / from custom route");
259
258
  reply
260
259
  .type("text/html")
261
260
  .sendFile("index.html", path.join(process.cwd(), "storage/documents"));