The group table's column is called "description" but we expose it in the API as "comment". Adjust internally used SQL to translate between them (this was already implemented and working for comment editing)

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2023-11-19 07:46:51 +01:00
parent 17716ef51a
commit ad5d078193
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD
1 changed files with 3 additions and 3 deletions

View File

@ -1626,7 +1626,7 @@ bool gravityDB_addToTable(const enum gravity_list_type listtype, tablerow *row,
// The item is the item for all POST requests
if(listtype == GRAVITY_GROUPS)
{
querystr = "INSERT INTO \"group\" (name,enabled,description) VALUES (:item,:enabled,:description);";
querystr = "INSERT INTO \"group\" (name,enabled,description) VALUES (:item,:enabled,:comment);";
}
else if(listtype == GRAVITY_ADLISTS)
{
@ -1648,8 +1648,8 @@ bool gravityDB_addToTable(const enum gravity_list_type listtype, tablerow *row,
if(row->name == NULL)
{
// Name is not to be changed
querystr = "INSERT INTO \"group\" (name,enabled,description) VALUES (:item,:enabled,:description) "
"ON CONFLICT(name) DO UPDATE SET enabled = :enabled, description = :description;";
querystr = "INSERT INTO \"group\" (name,enabled,description) VALUES (:item,:enabled,:comment) "
"ON CONFLICT(name) DO UPDATE SET enabled = :enabled, description = :comment;";
}
else
{