summaryrefslogtreecommitdiffstats
path: root/src/json.h
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2021-06-29 17:19:15 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2021-07-01 09:20:46 +0200
commit7325a8629ebd718fe3546fc4105ffeeacd83232a (patch)
tree79084e6676389025885bb114bbd33f74bd59eb60 /src/json.h
parenta496da17ea042244ec97e50a96ed64e5bda6e000 (diff)
#915 Add POST /task/add method
Adds the possibility to create a task with procedures and other tasks integrated as steps. Note: "steps" parameter is optional and "steps" array object order defines execution order. Request: POST /task/add { "center": "1", "name": "task", "description": "My task", "steps": [ { "procedure": 4 }, { "task": 1 }, { "procedure": 24 } ] } Response: 200 OK This commit also add task case to procedure's step processing. Otherwise, gcc prints the following warning: src/rest.c: In function ‘og_procedure_add_steps’: src/rest.c:4089:17: warning: enumeration value ‘OG_STEP_TASK’ not handled in switch [-Wswitch] 4089 | switch (step->type) { | ^~~~~~
Diffstat (limited to 'src/json.h')
-rw-r--r--src/json.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/json.h b/src/json.h
index 1790d24..0d00679 100644
--- a/src/json.h
+++ b/src/json.h
@@ -105,6 +105,7 @@ struct og_cmd_json {
enum og_procedure_step_type {
OG_STEP_COMMAND = 0,
OG_STEP_PROCEDURE,
+ OG_STEP_TASK,
};
#define OG_PROCEDURE_STEPS_MAX 256