Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hubbel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
PsyErgo-ForDemocracy
hubbel
Merge requests
!7
Cherry-pick admin capabilities from SLS
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Cherry-pick admin capabilities from SLS
admin-cherry
into
main
Overview
0
Commits
3
Pipelines
0
Changes
12
Merged
Ghost User
requested to merge
admin-cherry
into
main
1 year ago
Overview
0
Commits
3
Pipelines
0
Changes
12
Expand
This cherry-picks some changes from the SLS fork.
0
0
Merge request reports
Viewing commit
69e09591
Prev
Next
Show latest version
12 files
+
465
−
86
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
12
Search (e.g. *.vue) (Ctrl+P)
69e09591
Admin-Tool v2
· 69e09591
Simon Maier
authored
2 years ago
backend/src/controllers/topic.controller.js
+
21
−
0
Options
@@ -231,6 +231,27 @@ exports.findAllApproved = (req, res) => {
};
exports
.
findAll
=
async
(
req
,
res
)
=>
{
Topic
.
findAll
({
attributes
:[
"
topic_id
"
,
"
name
"
,
"
approved
"
,
"
information
"
]}).
then
(
data
=>
res
.
send
(
data
)
).
catch
(
err
=>
{
res
.
status
(
responseStatusCodes
.
InternalServerError
).
send
({
message
:
err
.
message
||
"
Error retrieving Topics with all approved Stati
"
});
});
};
exports
.
updateTopicApproved
=
async
(
req
,
res
)
=>
{
Topic
.
update
({
approved
:
req
.
body
.
approved
},
{
where
:
{
topic_id
:
req
.
body
.
topic_id
}
}).
then
(
data
=>
{
if
(
data
[
0
]
===
1
)
{
logger
.
log
(
`Topic was
${
req
.
body
.
approved
?
"
activated
"
:
"
deactivated
"
}
with id:
${
req
.
body
.
topic_id
}
`
);
res
.
send
(
true
);
}
}).
catch
(
err
=>
{
logger
.
error
(
"
Error approving topic
"
,
err
);
});
};
exports
.
pinTopic
=
async
(
req
,
res
)
=>
{
const
user_id
=
parseInt
(
req
.
user
.
user_id
);
const
topic_id
=
parseInt
(
req
.
params
.
topic_id
);
Loading