File tree 2 files changed +6
-32
lines changed
2 files changed +6
-32
lines changed Original file line number Diff line number Diff line change @@ -345,21 +345,11 @@ def deleteMusicPackage(name):
345
345
346
346
## Programs
347
347
348
- def saveAsNewProgram (body ):
349
- overwrite = body .get ("overwrite" )
350
- existing_program = prog_engine .load (body .get ("name" ))
351
- if existing_program and not overwrite :
352
- return "askOverwrite"
353
- elif existing_program and existing_program .is_default () == True :
354
- return "defaultOverwrite"
355
- program = Program (name = body .get ("name" ), code = body .get ("code" ), dom_code = body .get ("dom_code" ))
356
- prog_engine .save (program )
357
- return 200
358
-
359
348
def saveProgram (name , body ):
360
349
overwrite = body .get ("overwrite" )
361
350
existing_program = prog_engine .load (name )
362
- if existing_program and not overwrite :
351
+ logging .info ("saving - name: %s, body: %s" , name , str (existing_program ))
352
+ if existing_program is not None and not overwrite :
363
353
return "askOverwrite"
364
354
elif existing_program and existing_program .is_default () == True :
365
355
return "defaultOverwrite"
Original file line number Diff line number Diff line change @@ -159,23 +159,7 @@ paths:
159
159
responses :
160
160
200 :
161
161
description : " ok"
162
- post :
163
- operationId : " api.saveAsNewProgram"
164
- summary : " Save a new program"
165
- tags :
166
- - Program management
167
- requestBody :
168
- description : Optional description in *Markdown*
169
- required : true
170
- content :
171
- application/json :
172
- schema :
173
- $ref : ' #/components/schemas/Program'
174
- responses :
175
- 200 :
176
- description : " ok"
177
- 400 :
178
- description : " Failed to save the program"
162
+
179
163
/programs/{name} :
180
164
get :
181
165
operationId : " api.loadProgram"
@@ -217,7 +201,7 @@ paths:
217
201
schema :
218
202
type : string
219
203
requestBody :
220
- description : Optional description in *Markdown*
204
+ description : Program object
221
205
required : true
222
206
content :
223
207
application/json :
@@ -242,7 +226,7 @@ paths:
242
226
schema :
243
227
type : string
244
228
requestBody :
245
- description : Optional description in *Markdown*
229
+ description : Program object
246
230
required : true
247
231
content :
248
232
application/json :
@@ -683,7 +667,7 @@ components:
683
667
minLength : 1
684
668
dom_code :
685
669
type : string
686
- isDefualt :
670
+ default :
687
671
type : boolean
688
672
overwrite :
689
673
type : boolean
You can’t perform that action at this time.
0 commit comments