more api tweaks

removed WebfrontSettings
IW4MAdminSettings are only generated when the file does not exist, placeholder values stored in DefaultSettings.json
This commit is contained in:
RaidMax
2018-04-19 00:48:14 -05:00
parent 23ec72e6b6
commit 438718507b
31 changed files with 310 additions and 77 deletions

View File

@ -9,7 +9,7 @@ class Instance(Resource):
def get(self, id=None):
if id is None:
schema = InstanceSchema(many=True)
instances = schema.dump(ctx.instance_list.values())
instances = schema.dump(ctx.get_instances())
return instances
else:
try:
@ -25,13 +25,13 @@ class Instance(Resource):
except ValidationError as err:
return {'message' : err.messages }, 400
ctx.update_instance(instance)
return InstanceSchema().dump(instance)
return { 'message' : 'instance updated successfully' }, 200
@jwt_required
def post(self):
try:
instance = InstanceSchema().load(request.json)
except ValidationError as err:
return err.messages
return {'message' : err.messages }, 400
ctx.add_instance(instance)
return InstanceSchema().dump(instance)
return { 'message' : 'instance added successfully' }, 200