verbb / comments

A Craft CMS plugin for managing comments directly within the CMS.
Other
137 stars 33 forks source link

Add support for Votes to Feed Me integration #289

Closed JeroenOnstuimig closed 11 months ago

JeroenOnstuimig commented 11 months ago

Hey again! This PR adds support for importing comment votes to the Feed Me integration.

An example import feed (JSON) would look like this:

{
  "comments": [
    {
      "comment": "Example comment",
      "author": 123,
      "votes": [
        {
          "type": "up",
          "user": 456,
          "date": 1690206345
        },
        {
          "type": "down",
          "user": 789,
          "date": 1690206378
        }
      ]
    }
   ]
}

Importing the lastIp value of a vote is also possible when storeUserIps is set to true.

When updating an existing comment while the vote fields are mapped in the feed will remove all exising votes from the comment before importing the new ones. When the vote fields are not mapped, existing votes will be preserved.

engram-design commented 11 months ago

This is great, thanks!