Преглед изворни кода

mastoapi: more list tweaks.

default пре 2 година
родитељ
комит
71c0799231
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      mastoapi.c

+ 5 - 0
mastoapi.c

@@ -2907,6 +2907,10 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
             if (op && id && xs_is_hex(id)) {
             if (op && id && xs_is_hex(id)) {
                 if (strcmp(op, "accounts") == 0) {
                 if (strcmp(op, "accounts") == 0) {
                     const xs_list *accts = xs_dict_get(args, "account_ids[]");
                     const xs_list *accts = xs_dict_get(args, "account_ids[]");
+
+                    if (xs_is_null(accts))
+                        accts = xs_dict_get(args, "account_ids");
+
                     int c = 0;
                     int c = 0;
                     const char *v;
                     const char *v;
 
 
@@ -2914,6 +2918,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
                         list_content(&snac, id, v, 1);
                         list_content(&snac, id, v, 1);
                     }
                     }
 
 
+                    *ctype = "application/json";
                     status = HTTP_STATUS_OK;
                     status = HTTP_STATUS_OK;
                 }
                 }
             }
             }