You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| content ->> '_tenant' = '${tenant.id.value}' AND
313
+
| (content ->> 'state' = 'published' OR
314
+
| $$1 OR
315
+
| content ->> 'team' IN ($$2))
316
+
| AND
317
+
| (case
318
+
| WHEN $$3 THEN content ->> 'visibility' = '${ApiVisibility.Public.name}'
319
+
| WHEN $$1 THEN TRUE
320
+
| ELSE (content ->> 'visibility' IN ('${ApiVisibility.Public.name}', '${ApiVisibility.PublicWithAuthorizations.name}') OR (content ->> 'team' in ($$2)) OR (content -> 'authorizedTeams' ?| ARRAY[$$2]))
321
+
| END) AND
322
+
| (content ->> 'name' ~* COALESCE(NULLIF($$4, ''), '.*')) AND
323
+
| (_deleted = false) AND
324
+
| (COALESCE($$5, '') = '' OR content ->> 'team' = $$5) AND
325
+
| (COALESCE($$6, '') = '' OR content -> 'tags' ? $$6) AND
326
+
| (COALESCE($$7, '') = '' OR content -> 'categories' ? $$7) AND
327
+
| (COALESCE($$8, '') = '' OR (content ->> '_id' IN (SELECT jsonb_array_elements_text(content -> 'apis')
328
+
| FROM apis
329
+
| WHERE _id = $$8))) AND
330
+
| (content ->> 'isDefault')::boolean
331
+
|)
332
+
|ORDER BY LOWER(content ->> 'name')
333
+
|""".stripMargin
334
+
316
335
defgetVisibleApis(
317
336
teamId: Option[String] =None,
318
337
research: String,
@@ -348,44 +367,9 @@ object CommonServices {
348
367
"status.status"->"Pending"
349
368
)
350
369
)
351
-
allVisibleApisSqlQuery =
352
-
s"""
353
-
|SELECT content
354
-
|FROM apis
355
-
|WHERE (
356
-
| content ->> '_tenant' = '${ctx.tenant.id.value}' AND
357
-
| (content ->> 'state' = 'published' OR
358
-
| $$1 OR
359
-
| content ->> 'team' IN ($$2))
360
-
| AND
361
-
| (case
362
-
| WHEN $$3 THEN content ->> 'visibility' = '${ApiVisibility.Public.name}'
363
-
| WHEN $$1 THEN TRUE
364
-
| ELSE (content ->> 'visibility' IN ('${ApiVisibility.Public.name}', '${ApiVisibility.PublicWithAuthorizations.name}') OR (content ->> 'team' in ($$2)) OR (content -> 'authorizedTeams' ?| ARRAY[$$2]))
365
-
| END) AND
366
-
| (content ->> 'name' ~* COALESCE(NULLIF($$4, ''), '.*')) AND
367
-
| (_deleted = false) AND
368
-
| (COALESCE($$5, '') = '' OR content ->> 'team' = $$5) AND
369
-
| (COALESCE($$6, '') = '' OR content -> 'tags' ? $$6) AND
370
-
| (COALESCE($$7, '') = '' OR content -> 'categories' ? $$7) AND
371
-
| (COALESCE($$8, '') = '' OR (content ->> '_id' IN (SELECT jsonb_array_elements_text(content -> 'apis')
0 commit comments