diff --git a/config/modules.json b/config/modules.json index 3d6a035..f6b6e74 100644 --- a/config/modules.json +++ b/config/modules.json @@ -216,10 +216,10 @@ "category": { "GET": { - "des" : "Get all data about a professor category", + "des" : "Get all data about a given category | all", "per": [], "par": { - "URL0":{"des" : "Id of the category", "typ": "id", "ren": "idCat", "opt" : true} + "URL0": { "des": "Id of the category", "typ": "id", "ren": "cat_id", "opt": true } } } } diff --git a/webpack/component/teacher/view.vue b/webpack/component/teacher/view.vue index f4976cd..11c7916 100644 --- a/webpack/component/teacher/view.vue +++ b/webpack/component/teacher/view.vue @@ -6,17 +6,11 @@
-
+

diff --git a/webpack/data/teacher.js b/webpack/data/teacher.js index a20c332..ab499ee 100644 --- a/webpack/data/teacher.js +++ b/webpack/data/teacher.js @@ -17,6 +17,26 @@ api.call('GET professor/1/', { vh: true }, function(rs){ + +/* (2) Load categories (for creating a professor) +---------------------------------------------------------*/ +/* (1) Initialize list */ +gstore.add('categories', []); + +/* (2) Get categories */ +api.call('GET category', { vh: true }, function(rs){ + + // {1} If error -> abort // + if( rs.error !== 0 )return console.log('No categorie found, error: '+rs.error); + console.log(rs); + + // {2} Store categories // + gstore.get.categories = rs.categories; + +}); + + + /* (2) Define filters' callback ---------------------------------------------------------*/ /* (1) Define global callback */