diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-04-16 23:07:14 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-04-16 23:07:14 +0200 |
commit | 4a6f917151c9a33d22d57467d3bc110add0fe11f (patch) | |
tree | 2cc4979a74e32695ddc1bf4c40c8cf8d543445e0 /src/lib/merchant_api_delete_instance.c | |
parent | 7d425da40e2500456caab083518b889921945356 (diff) |
enable use of per-instance APIs also in C API
Diffstat (limited to 'src/lib/merchant_api_delete_instance.c')
-rw-r--r-- | src/lib/merchant_api_delete_instance.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/lib/merchant_api_delete_instance.c b/src/lib/merchant_api_delete_instance.c index 4568f7e1..4ef40952 100644 --- a/src/lib/merchant_api_delete_instance.c +++ b/src/lib/merchant_api_delete_instance.c @@ -140,24 +140,29 @@ instance_delete (struct GNUNET_CURL_Context *ctx, idh->ctx = ctx; idh->cb = cb; idh->cb_cls = cb_cls; + if (NULL != instance_id) { char *path; GNUNET_asprintf (&path, "instances/%s/private", instance_id); - if (purge) - idh->url = TALER_url_join (backend_url, - path, - "purge", - "yes", - NULL); - else - idh->url = TALER_url_join (backend_url, - path, - NULL); + idh->url = TALER_url_join (backend_url, + path, + "purge", + (purge) ? "yes" : NULL, + NULL); GNUNET_free (path); } + else + { + /* backend_url is already identifying the instance */ + idh->url = TALER_url_join (backend_url, + "/private", + "purge", + (purge) ? "yes" : NULL, + NULL); + } if (NULL == idh->url) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |