fossasia / susi_server

SUSI.AI server backend - the Artificial Intelligence server for personal assistants https://susi.ai
GNU Lesser General Public License v2.1
2.51k stars 1.08k forks source link

Update GetReportSkillServer Servlet #1281 #1282

Closed fragm3 closed 5 years ago

fragm3 commented 5 years ago

Fixes #1281

Changes: Segregate the same skills reported skills in the same array.

Required for PR: https://github.com/fossasia/susi.ai/pull/2374

fragm3 commented 5 years ago

Search Result:

{
...
  "list": [{
    "reports": [
      {
        "feedback": "Hello",
        "email": "shubhams@gmail.com"
      },
      {
        "feedback": "Hello 2",
        "email": "shubhamsuperpro@gmail.com"
      }
    ],
    "skill_name": "GSOC111",
    "language": "en",
    "model": "general",
    "group": "Communication"
  }],
  "message": "Success: Fetched all Reported Skills"
}

Normal list result:

{
...
  "list": [
    {
      "reports": [{
        "feedback": "Hello 2",
        "email": "shubhamsuperpro@gmail.com"
      }],
      "skill_name": "GSOC34567",
      "language": "DFGH",
      "model": "general",
      "group": "Test"
    },
    {
      "reports": [
        {
          "feedback": "Hello",
          "email": "shubhams@gmail.com"
        },
        {
          "feedback": "Hello 2",
          "email": "shubhamsuperpro@gmail.com"
        }
      ],
      "skill_name": "GSOC111",
      "language": "en",
      "model": "general",
      "group": "Communication"
    },
    {
      "reports": [{
        "feedback": "Hello",
        "email": "shubhams@gmail.com"
      }],
      "skill_name": "GSOC101",
      "language": "en",
      "model": "general",
      "group": "Communication"
    },
    {
      "reports": [{
        "feedback": "Hello",
        "email": "shubhams@gmail.com"
      }],
      "skill_name": "GSOC1",
      "language": "en",
      "model": "general",
      "group": "Communication"
    }
  ],
  "message": "Success: Fetched all Reported Skills"
}
fragm3 commented 5 years ago

@akshatnitd @Orbiter please review.