Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CD-CODE Web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CD-CODE team
CD-CODE Web
Commits
74194aa8
Commit
74194aa8
authored
2 years ago
by
raghosh
Browse files
Options
Downloads
Patches
Plain Diff
#68
: updated contributor function.
parent
f228b91f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cms/src/api/novel-condensate/controllers/novel-condensate.js
+1
-1
1 addition, 1 deletion
cms/src/api/novel-condensate/controllers/novel-condensate.js
cms/src/api/update-item/controllers/update-item.js
+49
-4
49 additions, 4 deletions
cms/src/api/update-item/controllers/update-item.js
with
50 additions
and
5 deletions
cms/src/api/novel-condensate/controllers/novel-condensate.js
+
1
−
1
View file @
74194aa8
...
...
@@ -76,7 +76,7 @@ module.exports = createCoreController('api::novel-condensate.novel-condensate',
const
{
query
}
=
ctx
;
query
[
'
populate
'
]
=
[
'
submittedBy
'
,
'
reviewedBy
'
];
let
entity
=
await
strapi
.
service
(
"
api::
update-item.update-i
te
m
"
).
findOne
(
id
,
query
);
let
entity
=
await
strapi
.
service
(
"
api::
novel-condensate.novel-condensa
te
"
).
findOne
(
id
,
query
);
switch
(
ctx
.
state
.
user
.
role
.
name
)
{
case
'
Public
'
:
...
...
This diff is collapsed.
Click to expand it.
cms/src/api/update-item/controllers/update-item.js
+
49
−
4
View file @
74194aa8
...
...
@@ -281,8 +281,15 @@ module.exports = createCoreController('api::update-item.update-item', ({ strapi
if
(
ctx
.
params
.
entity
===
'
condensate
'
)
{
const
[
entries
]
=
await
strapi
.
db
.
query
(
'
plugin::users-permissions.user
'
).
findWithCount
({
select
:
[
'
username
'
,
'
full_name
'
],
populate
:
{
role
:
{
where
:
{
$not
:
{
name
:
'
Maintainer
'
,
}
}
},
SubmittedUpdateItems
:
{
where
:
{
EntityId
:
{
$contains
:
ctx
.
params
.
id
,
},
...
...
@@ -291,17 +298,28 @@ module.exports = createCoreController('api::update-item.update-item', ({ strapi
},
}
},
orderBy
:
{
id
:
'
DESC
'
}
,
select
:
[
'
username
'
,
'
full_name
'
]
,
orderBy
:
{
id
:
'
DESC
'
},
});
const
{
data
,
meta
}
=
await
super
.
find
(
ctx
);
const
filteredEntries
=
entries
.
filter
(
f
=>
f
.
role
!==
null
)
return
{
entries
,
meta
};
return
{
filteredEntries
,
meta
};
}
else
if
(
ctx
.
params
.
entity
===
'
protein
'
)
{
const
[
entries
]
=
await
strapi
.
db
.
query
(
'
plugin::users-permissions.user
'
).
findWithCount
({
select
:
[
'
username
'
,
'
full_name
'
],
populate
:
{
role
:
{
where
:
{
$not
:
{
name
:
'
Maintainer
'
,
}
}
},
SubmittedUpdateItems
:
{
where
:
{
EntityId
:
{
$eq
:
ctx
.
params
.
id
,
},
...
...
@@ -315,9 +333,36 @@ module.exports = createCoreController('api::update-item.update-item', ({ strapi
});
const
{
data
,
meta
}
=
await
super
.
find
(
ctx
);
const
filteredEntries
=
entries
.
filter
(
f
=>
f
.
role
!==
null
)
return
{
filteredEntries
,
meta
};
}
else
if
(
ctx
.
params
.
entity
===
'
all
'
)
{
const
[
entries
]
=
await
strapi
.
db
.
query
(
'
plugin::users-permissions.user
'
).
findWithCount
({
return
{
entries
,
meta
};
select
:
[
'
username
'
,
'
full_name
'
],
populate
:
{
role
:
{
where
:
{
$not
:
{
name
:
'
Maintainer
'
,
}
}
},
SubmittedUpdateItems
:
{
where
:
{
Status
:
'
synced
'
,
},
}
},
orderBy
:
{
id
:
'
DESC
'
},
});
const
{
data
,
meta
}
=
await
super
.
find
(
ctx
);
const
filteredEntries
=
entries
.
filter
(
f
=>
f
.
role
!==
null
)
return
{
filteredEntries
,
meta
};
}
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment