summaryrefslogtreecommitdiff
path: root/src/backenddb/pg_update_template.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backenddb/pg_update_template.c')
-rw-r--r--src/backenddb/pg_update_template.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/backenddb/pg_update_template.c b/src/backenddb/pg_update_template.c
index 9f7f37c3..c0c35df3 100644
--- a/src/backenddb/pg_update_template.c
+++ b/src/backenddb/pg_update_template.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2022 Taler Systems SA
+ Copyright (C) 2022-2024 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -26,17 +26,6 @@
#include "pg_helper.h"
-/**
- * Update details about a particular template.
- *
- * @param cls closure
- * @param instance_id instance to update template for
- * @param template_id template to update
- * @param td update to the template details on success, can be NULL
- * (in that case we only want to check if the template exists)
- * @return database result code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if the template
- * does not yet exist.
- */
enum GNUNET_DB_QueryStatus
TMH_PG_update_template (void *cls,
const char *instance_id,
@@ -52,6 +41,12 @@ TMH_PG_update_template (void *cls,
? GNUNET_PQ_query_param_null ()
: GNUNET_PQ_query_param_string (td->otp_id),
TALER_PQ_query_param_json (td->template_contract),
+ (NULL == td->editable_defaults)
+ ? GNUNET_PQ_query_param_null ()
+ : TALER_PQ_query_param_json (td->editable_defaults),
+ (NULL == td->required_currency)
+ ? GNUNET_PQ_query_param_null ()
+ : GNUNET_PQ_query_param_string (td->required_currency),
GNUNET_PQ_query_param_end
};
@@ -73,6 +68,8 @@ TMH_PG_update_template (void *cls,
" COALESCE((SELECT otp_serial"
" FROM otp), NULL)"
",template_contract=$5"
+ ",editable_defaults=$6"
+ ",required_currency=$7"
" WHERE merchant_serial="
" (SELECT merchant_serial"
" FROM mid)"
@@ -81,5 +78,3 @@ TMH_PG_update_template (void *cls,
"update_template",
params);
}
-
-