diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rest.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -4802,6 +4802,7 @@ static int og_cmd_post_repository_update(json_t *element, } else if (!strcmp(key, "name")) { err = og_json_parse_string_copy(value, name, sizeof(name)); + params->flags |= OG_REST_PARAM_NAME; } else if (!strcmp(key, "addr")) { err = og_json_parse_clients(value, params); } @@ -4810,6 +4811,7 @@ static int og_cmd_post_repository_update(json_t *element, return err; } if (!og_msg_params_validate(params, OG_REST_PARAM_ID | + OG_REST_PARAM_NAME | OG_REST_PARAM_ADDR)) return -1; @@ -4884,6 +4886,7 @@ static int og_cmd_post_repository_add(json_t *element, if (!strcmp(key, "name")) { err = og_json_parse_string_copy(value, name, sizeof(name)); + params->flags |= OG_REST_PARAM_NAME; } else if (!strcmp(key, "addr")) { err = og_json_parse_clients(value, params); } @@ -4892,7 +4895,8 @@ static int og_cmd_post_repository_add(json_t *element, return err; } - if (!og_msg_params_validate(params, OG_REST_PARAM_ADDR)) + if (!og_msg_params_validate(params, OG_REST_PARAM_ADDR | + OG_REST_PARAM_NAME)) return -1; dbi = og_dbi_open(&ogconfig.db); |