Skip to content

Commit 916c737

Browse files
authored
Merge pull request #129 from manipalutsav/download-certificate-btn
2 parents d3227f9 + 12a1e6c commit 916c737

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/controllers/settings.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ const get = async (req, res) => {
3232
data: settings[setting],
3333
});
3434
}
35-
3635
return res.json({
3736
status: 404,
3837
message: "No setting found with the given name",
@@ -70,8 +69,9 @@ const getAll = async (req, res) => {
7069
};
7170

7271
const updateSettings = async (req, res) => {
73-
let { title, editTeamEnabled } = req.body;
74-
if( title === null || editTeamEnabled === null) {
72+
73+
let { title, editTeamEnabled, downloadCertificateEnabled } = req.body;
74+
if( title === null || editTeamEnabled === null || downloadCertificateEnabled === null) {
7575
return res.status(404).json({
7676
status: 400,
7777
message: "Bad request",
@@ -85,10 +85,12 @@ const updateSettings = async (req, res) => {
8585
setting = await SettingModel.create({
8686
title: title,
8787
editTeamEnabled: editTeamEnabled,
88+
downloadCertificateEnabled: downloadCertificateEnabled,
8889
});
8990
}else{
9091
setting.title = title;
9192
setting.editTeamEnabled = editTeamEnabled;
93+
setting.downloadCertificateEnabled = downloadCertificateEnabled;
9294
await setting.save();
9395
}
9496

src/models/Setting.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ const schema = {
1010
type: Boolean,
1111
required: true,
1212
},
13+
downloadCertificateEnabled:{
14+
type: Boolean,
15+
required: true,
16+
}
1317
};
1418

1519
const options = {

0 commit comments

Comments
 (0)