From ec7e9dbe953ad15dd0ddf027941c3282d49dc19c Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 2 Mar 2020 23:12:14 +0100 Subject: [PATCH] [DEV] update dynamique when modify --- back/src/api/video.py | 2 +- back/src/create_bdd.py | 31 +------------------- front/src/app/scene/video-edit/video-edit.ts | 9 ++++-- front/src/app/scene/video/video.component.ts | 2 +- front/src/app/service/dataInterface.ts | 6 ++-- 5 files changed, 13 insertions(+), 37 deletions(-) diff --git a/back/src/api/video.py b/back/src/api/video.py index 6f0b786..98b3cb2 100644 --- a/back/src/api/video.py +++ b/back/src/api/video.py @@ -231,7 +231,7 @@ def add(_app, _name_api): @doc.response_success(status=201, description='If successful updated') async def update(request, id): ret = data_global_elements.get_interface(_name_api).put(id, request.json) - return response.json({"update":"done"}); + return response.json(ret); @elem_blueprint.delete('/' + _name_api + '/', strict_slashes=True) @doc.summary("Remove resource") diff --git a/back/src/create_bdd.py b/back/src/create_bdd.py index 6b397bc..5db519a 100755 --- a/back/src/create_bdd.py +++ b/back/src/create_bdd.py @@ -151,7 +151,7 @@ def create_if_needed(): c.execute(''' CREATE TRIGGER set_timestamp - BEFORE UPDATE ON object + AFTER UPDATE ON object FOR EACH ROW EXECUTE PROCEDURE trigger_set_timestamp(); ''') @@ -174,14 +174,6 @@ def create_if_needed(): ''') connection.commit() - c.execute(''' - CREATE TRIGGER set_timestamp_data - BEFORE UPDATE ON data - FOR EACH ROW - EXECUTE PROCEDURE trigger_set_timestamp(); - ''') - connection.commit() - debug.info("Add NODE interface"); @@ -198,13 +190,6 @@ def create_if_needed(): COMMENT ON COLUMN node.description IS 'Description of the Node.'; ''') connection.commit() - c.execute(''' - CREATE TRIGGER set_timestamp_node - BEFORE UPDATE ON node - FOR EACH ROW - EXECUTE PROCEDURE trigger_set_timestamp(); - ''') - connection.commit() debug.info("Add Cover interface"); # Create table @@ -216,13 +201,6 @@ def create_if_needed(): COMMENT ON TABLE cover_link IS 'Link between cover data id and Nodes.'; ''') connection.commit() - c.execute(''' - CREATE TRIGGER set_timestamp_cover_link - BEFORE UPDATE ON cover_link - FOR EACH ROW - EXECUTE PROCEDURE trigger_set_timestamp(); - ''') - connection.commit() debug.info("Add MEDIA interface"); # Create table @@ -247,13 +225,6 @@ def create_if_needed(): # Save (commit) the changes connection.commit() - c.execute(''' - CREATE TRIGGER set_timestamp_media - BEFORE UPDATE ON media - FOR EACH ROW - EXECUTE PROCEDURE trigger_set_timestamp(); - ''') - connection.commit() debug.info("Add Views models"); diff --git a/front/src/app/scene/video-edit/video-edit.ts b/front/src/app/scene/video-edit/video-edit.ts index 16d920c..893c715 100644 --- a/front/src/app/scene/video-edit/video-edit.ts +++ b/front/src/app/scene/video-edit/video-edit.ts @@ -41,7 +41,7 @@ class DataToSend { data_id:number = -1 time:number = undefined type_id:number = undefined - covers:Array = []; + covers:Array = []; generated_name:string = "" clone() { let tmp = new DataToSend(); @@ -80,7 +80,7 @@ export class VideoEditComponent implements OnInit { selectedFiles:FileList; need_send:boolean = false; - covers_display:Array = []; + covers_display:Array = []; listType: ElementList[] = [ {value: undefined, label: '---'}, @@ -188,7 +188,10 @@ export class VideoEditComponent implements OnInit { if (response.covers !== undefined && response.covers !== null) { for (let iii=0; iii