diff --git a/back/src/api/group.py b/back/src/api/group.py index e8de7ed..af97f49 100644 --- a/back/src/api/group.py +++ b/back/src/api/group.py @@ -35,12 +35,14 @@ def add(_app, _name_api): class DataModelBdd: id = int name = str + description = [str, type(None)] covers = [[], type(None)] data_global_elements.get_interface(_name_api).set_data_model(DataModelBdd) class DataModel: name = str + description = str @elem_blueprint.get('/' + _name_api, strict_slashes=True) @doc.summary("Show resources") @@ -135,8 +137,8 @@ def add(_app, _name_api): raise ServerError("No data found", status_code=404) @elem_blueprint.post('/' + _name_api + "//add_cover", strict_slashes=True) - @doc.summary("Add cover on video") - @doc.description("Add a cover data ID to the video.") + @doc.summary("Add cover on group") + @doc.description("Add a cover data ID to the group.") @doc.consumes(DataModel, location='body')#, required=True) @doc.response_success(status=201, description='If successful added') async def create(request, id): @@ -155,6 +157,6 @@ def add(_app, _name_api): return response.json(elem) value["covers"].append(request.json["data_id"]); data_global_elements.get_interface(_name_api).set(id, value) - return response.json(elem) + return response.json(value) _app.blueprint(elem_blueprint) diff --git a/back/src/api/saison.py b/back/src/api/saison.py index 620e41c..fa3ffd8 100644 --- a/back/src/api/saison.py +++ b/back/src/api/saison.py @@ -35,6 +35,7 @@ def add(_app, _name_api): class DataModelBdd: id = int number = int + description = [str, type(None)] group_id = int covers = [[], type(None)] @@ -42,6 +43,7 @@ def add(_app, _name_api): class DataModel: number = int + description = str group_id = int @elem_blueprint.get('/' + _name_api, strict_slashes=True) @@ -131,6 +133,6 @@ def add(_app, _name_api): return response.json(elem) value["covers"].append(request.json["data_id"]); data_global_elements.get_interface(_name_api).set(id, value) - return response.json(elem) + return response.json(value) _app.blueprint(elem_blueprint) diff --git a/back/src/api/univers.py b/back/src/api/univers.py index 2ca1eba..7936c07 100644 --- a/back/src/api/univers.py +++ b/back/src/api/univers.py @@ -127,8 +127,8 @@ def add(_app, _name_api): return response.json(list_values) @elem_blueprint.post('/' + _name_api + "//add_cover", strict_slashes=True) - @doc.summary("Add cover on video") - @doc.description("Add a cover data ID to the video.") + @doc.summary("Add cover on univers") + @doc.description("Add a cover data ID to the univers.") @doc.consumes(DataModel, location='body')#, required=True) @doc.response_success(status=201, description='If successful added') async def create(request, id): @@ -147,6 +147,6 @@ def add(_app, _name_api): return response.json(elem) value["covers"].append(request.json["data_id"]); data_global_elements.get_interface(_name_api).set(id, value) - return response.json(elem) + return response.json(value) _app.blueprint(elem_blueprint) \ No newline at end of file