Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    1. Home
    2. Tilen Štraus
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 4
    • Best 0
    • Groups 0

    Tilen Štraus

    @Tilen Štraus

    0
    Reputation
    670
    Profile views
    4
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Tilen Štraus Follow

    Latest posts made by Tilen Štraus

    • Nodebb shuts down(502 bad gateway)

      Hi again,

      I ran into some problem with NodeBB. I'm working with google apps script, taking data from a spreadsheet and inserting it into NodeBB via write api. First I insert a Category. then I insert another Category and update it's ParentID from the previously inserted Category, then I insert the topic and lastly I insert the post to the topic. After this procedure everything shuts down:

      • 29/8 15:00 [22748] - error: TypeError: data.content.rtrim is not a function(output.log),

      • (inside google script editor)

      And in another scenario where I already inserted Category and Category with updated ParentID everything works fine no errors no shutdown.

      posted in NodeBB Development
      Tilen Štraus
      Tilen Štraus
    • RE: Write api inserting/updating tags doesn't work

      Works now, i had to JSON.stringify()the data variable, set te contentType to "contentType" : "application/json" and 'tags[]' to 'tags'.

      Thank you all for helping 🙂

      posted in NodeBB Development
      Tilen Štraus
      Tilen Štraus
    • RE: Write api inserting/updating tags doesn't work

      Thank you for the quick answer @julian!
      I've tried your curl code and it works fine. The problem was that i've been using the wrong property('tags' instead of 'tags[]'). Now i'm getting a new problem when inserting an array [LJAVA.LANG.OBJECT@695575B6. Does he expect something else instead of the array? Here is my code for better understanding:

      var sub_cat_id = "146"
      var t_title = "test title"
      var t_content = "TESTESTESTESTEST";
      var cars = new Array("Saab", "Volvo", "BMW");

      var headers = {"Authorization" : "Bearer XXX"};
      var url = 'XX/api/v1/topics/';
      var data = {'cid' : sub_cat_id,
      'title' : t_title,
      'content' : t_content,
      'tags[]' : cars
      };

      var options = {
      'method': 'post',
      'headers': headers,
      'payload': data
      };
      var response = UrlFetchApp.fetch(url, options);
      Logger.log(response);

      I just tried almost everything 😃 JSON.stringify-gives only one tag with all of the values in the array. I srsly don't know what to do 😞 .

      Thank you again.

      posted in NodeBB Development
      Tilen Štraus
      Tilen Štraus
    • Write api inserting/updating tags doesn't work

      Hi guys,

      so the thing is everything was working with the write api so far, topics,posts etc., but I can't insert/update a post to add tags into it. I'm trying to solve this problem all day because I thought it's an issue in my code at first but it seems that it's a bug.

      I've tried:

      • /topics POST inserting the cid,title,content,tags(and yes It's an array)(only the topic showed up with all the data except tags, with no error),

      • /topics PUT with pid,content and tags(again no error and no tags, the content was updated)

      • /posts PUT:pid with content,tags (again content was updated, still no tags,no errors)

      I'm on NodeBB version v1.1.2.

      Thanks in advance!

      posted in NodeBB Development
      Tilen Štraus
      Tilen Štraus