File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ const get = async (req, res) => {
32
32
data : settings [ setting ] ,
33
33
} ) ;
34
34
}
35
-
36
35
return res . json ( {
37
36
status : 404 ,
38
37
message : "No setting found with the given name" ,
@@ -70,8 +69,9 @@ const getAll = async (req, res) => {
70
69
} ;
71
70
72
71
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 ) {
75
75
return res . status ( 404 ) . json ( {
76
76
status : 400 ,
77
77
message : "Bad request" ,
@@ -85,10 +85,12 @@ const updateSettings = async (req, res) => {
85
85
setting = await SettingModel . create ( {
86
86
title : title ,
87
87
editTeamEnabled : editTeamEnabled ,
88
+ downloadCertificateEnabled : downloadCertificateEnabled ,
88
89
} ) ;
89
90
} else {
90
91
setting . title = title ;
91
92
setting . editTeamEnabled = editTeamEnabled ;
93
+ setting . downloadCertificateEnabled = downloadCertificateEnabled ;
92
94
await setting . save ( ) ;
93
95
}
94
96
Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ const schema = {
10
10
type : Boolean ,
11
11
required : true ,
12
12
} ,
13
+ downloadCertificateEnabled :{
14
+ type : Boolean ,
15
+ required : true ,
16
+ }
13
17
} ;
14
18
15
19
const options = {
You can’t perform that action at this time.
0 commit comments