We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents df840da + 66e0565 commit 7045243Copy full SHA for 7045243
1 file changed
src/api/study/controllers/study.js
@@ -9,10 +9,14 @@ const { NotFoundError } = require('@strapi/utils').errors;
9
10
module.exports = createCoreController('api::study.study', ({ strapi }) => ({
11
async find(ctx) {
12
- ctx.query.filters = {
13
- ...ctx.query.filters,
14
- is_listed: true,
15
- };
+
+ // If not providing a dataset id, return only studies that are listed
+ if (!ctx.query.filters?.datasets?.id?.$eq){
+ ctx.query.filters = {
16
+ ...ctx.query.filters,
17
+ is_listed: true,
18
+ };
19
+ }
20
21
ctx.query = {
22
...ctx.query,
0 commit comments