[DEV] correct edit

This commit is contained in:
Edouard DUPIN 2020-01-29 22:19:36 +01:00
parent d1caff5cbd
commit c4100a7db4
3 changed files with 20 additions and 1 deletions

View File

@ -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)

View File

@ -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 {

View File

@ -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");