diff --git a/back/src/api/group.py b/back/src/api/group.py index 5fed0d8..bfa0d47 100644 --- a/back/src/api/group.py +++ b/back/src/api/group.py @@ -49,6 +49,12 @@ def add(_app, _name_api): @doc.description("Display a listing of the resource.") @doc.produces(content_type='application/json') async def list(request): + if "select" in request.args: + if request.args["select"] == "*": + list_values = data_global_elements.get_interface(_name_api).gets_where(select=[["!=", "id", None]], order_by=["name"]) + else: + list_values = data_global_elements.get_interface(_name_api).gets_where(select=[["!=", "id", None]], order_by=["name"], filter=request.args["select"]) + return response.json(list_values) return response.json(data_global_elements.get_interface(_name_api).gets()) @elem_blueprint.post('/' + _name_api, strict_slashes=True) diff --git a/front/src/app/scene/video-edit/video-edit.ts b/front/src/app/scene/video-edit/video-edit.ts index 92fdbeb..4a7e8d3 100644 --- a/front/src/app/scene/video-edit/video-edit.ts +++ b/front/src/app/scene/video-edit/video-edit.ts @@ -106,6 +106,14 @@ export class VideoEditComponent implements OnInit { }).catch(function(response2) { console.log("get response22 : " + JSON.stringify(response2, null, 2)); }); + this.groupService.getOrder() + .then(function(response3) { + for(let iii= 0; iii < response3.length; iii++) { + self.listGroup.push({value: response3[iii].id, label: response3[iii].name}); + } + }).catch(function(response3) { + console.log("get response3 : " + JSON.stringify(response3, null, 2)); + }); this.videoService.get(this.id_video) .then(function(response) { console.log("get response of video : " + JSON.stringify(response, null, 2)); @@ -147,9 +155,10 @@ export class VideoEditComponent implements OnInit { this.type_id = _value; this.group_id = null; this.saison_id = null; - this.listGroup = [{value: undefined, label: '---'}]; + //this.listGroup = [{value: undefined, label: '---'}]; this.listSaison = [{value: undefined, label: '---'}]; let self = this; + /* if (this.type_id != undefined) { self.typeService.getSubGroup(this.type_id, ["id", "name"]) .then(function(response2) { @@ -160,6 +169,7 @@ export class VideoEditComponent implements OnInit { console.log("get response22 : " + JSON.stringify(response2, null, 2)); }); } + */ } onChangeUnivers(_value:any):void { diff --git a/front/src/app/service/group.service.ts b/front/src/app/service/group.service.ts index 60099b6..79c12c9 100644 --- a/front/src/app/service/group.service.ts +++ b/front/src/app/service/group.service.ts @@ -13,6 +13,9 @@ export class GroupService { get(_id:number):any { return this.http.get_specific("group", _id); }; + getOrder(_id:number):any { + return this.http.get_specific("group", _id, "", ["name","id"]); + }; getVideoAll(_id:number):any { return this.http.get_specific("group", _id, "video_all");