Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra data returned by tip comment endpoint #197

Open
davidyuk opened this issue Oct 27, 2020 · 0 comments
Open

Extra data returned by tip comment endpoint #197

davidyuk opened this issue Oct 27, 2020 · 0 comments

Comments

@davidyuk
Copy link
Member

davidyuk commented Oct 27, 2020

In the example below the child comment is in both the root list of comments and in child comments. This may bring a significant amount of extra data in some cases, so I propose to choose one way and drop the other one. Currently, in superhero-ui used nested comments and their duplicated are filtered out.

One more inconsistency is that the Profile key (by the way, why it from the capital letter?) defined in the root array elements, but missed in children comments.

https://raendom-backend.z52da5wt.xyz/comment/api/tip/1834_v1

[
  {
    "id": 518,
    "tipId": "1834_v1",
    "text": "Nice",
    "author": "ak_YCwfWaW5ER6cRsG9Jg4KMyVU59bQkt45WvcnJJctQojCqBeG2",
    "hidden": false,
    "signature": "7cd1d524874614388361883a71bbce20fa4dc7f7a15f64038c37c4bd6f562e94904eb48bdbe9449f84b0c3d1af054b065f99672831d1deefc0de5aa00dff820b",
    "challenge": "f109270d-e6a8-4c96-8589-a60d47c76875-a4ec6ad0efcfb9625cffbf1bc21bc12db1cd96ead62b0aa30ef84b422807939d-CREATE_COMMENT-1599030397372-2-0-0",
    "parentId": null,
    "createdAt": "2020-09-02T07:06:38.647Z",
    "updatedAt": "2020-09-02T07:06:38.647Z",
    "hierarchyLevel": 1,
    "Profile": {
      "biography": "pickles2",
      "author": "ak_YCwfWaW5ER6cRsG9Jg4KMyVU59bQkt45WvcnJJctQojCqBeG2",
      "preferredChainName": "bruteforce.chain",
      "image": null,
      "referrer": null,
      "location": "",
      "coverImage": "ak_YCwfWaW5ER6cRsG9Jg4KMyVU59bQkt45WvcnJJctQojCqBeG2-1598457805644.jpg",
      "signature": "82634bebe006ad8df8cc1cf489506e166222e84557279d78259d6ad70d95cb1d6849bc08e30d26107df26f52b466ecb61d38f11ca84ff75a538aa8c1ea49d105",
      "challenge": "1e74b966-29d0-4753-aded-52b3196dbf7e-8b1e2adc0fd8b65f4cb974e7e13db59a3e4bdfb3a63e2ecfc519affa57b15363-CREATE_PROFILE-1603351082128-2-0-0",
      "imageSignature": null,
      "imageChallenge": null,
      "createdAt": "2020-03-20T05:43:12.812Z",
      "updatedAt": "2020-10-22T07:18:02.261Z"
    },
    "children": [
      {
        "id": 519,
        "tipId": "1834_v1",
        "text": "Actually this conference seems more than just \"nice\" from what I saw on the web. :)",
        "author": "ak_YCwfWaW5ER6cRsG9Jg4KMyVU59bQkt45WvcnJJctQojCqBeG2",
        "hidden": false,
        "signature": "f946330bbb08dc66563f2889954629182ed687290e10207c6367193d3183bc20fcf5e51785808976f91001a12634eab4c1e255419af42cc1d59cfa1421118f03",
        "challenge": "15f356be-ecc0-4c83-a6f5-87aa9f32a6f4-db2689ac98225bd0dd20132e20058209d29158ff7a493b7824372c3c64b4f72e-CREATE_COMMENT-1599032810484-2-0-0",
        "parentId": 518,
        "createdAt": "2020-09-02T07:46:52.556Z",
        "updatedAt": "2020-09-02T07:46:52.556Z",
        "hierarchyLevel": 2
      }
    ]
  },
  {
    "id": 519,
    "tipId": "1834_v1",
    "text": "Actually this conference seems more than just \"nice\" from what I saw on the web. :)",
    "author": "ak_YCwfWaW5ER6cRsG9Jg4KMyVU59bQkt45WvcnJJctQojCqBeG2",
    "hidden": false,
    "signature": "f946330bbb08dc66563f2889954629182ed687290e10207c6367193d3183bc20fcf5e51785808976f91001a12634eab4c1e255419af42cc1d59cfa1421118f03",
    "challenge": "15f356be-ecc0-4c83-a6f5-87aa9f32a6f4-db2689ac98225bd0dd20132e20058209d29158ff7a493b7824372c3c64b4f72e-CREATE_COMMENT-1599032810484-2-0-0",
    "parentId": 518,
    "createdAt": "2020-09-02T07:46:52.556Z",
    "updatedAt": "2020-09-02T07:46:52.556Z",
    "hierarchyLevel": 2,
    "Profile": {
      "biography": "pickles2",
      "author": "ak_YCwfWaW5ER6cRsG9Jg4KMyVU59bQkt45WvcnJJctQojCqBeG2",
      "preferredChainName": "bruteforce.chain",
      "image": null,
      "referrer": null,
      "location": "",
      "coverImage": "ak_YCwfWaW5ER6cRsG9Jg4KMyVU59bQkt45WvcnJJctQojCqBeG2-1598457805644.jpg",
      "signature": "82634bebe006ad8df8cc1cf489506e166222e84557279d78259d6ad70d95cb1d6849bc08e30d26107df26f52b466ecb61d38f11ca84ff75a538aa8c1ea49d105",
      "challenge": "1e74b966-29d0-4753-aded-52b3196dbf7e-8b1e2adc0fd8b65f4cb974e7e13db59a3e4bdfb3a63e2ecfc519affa57b15363-CREATE_PROFILE-1603351082128-2-0-0",
      "imageSignature": null,
      "imageChallenge": null,
      "createdAt": "2020-03-20T05:43:12.812Z",
      "updatedAt": "2020-10-22T07:18:02.261Z"
    },
    "children": []
  },
  ...
]

Interestingly, the comment replies endpoint places children once in nested arrays. For example, "great!" reply in https://raendom-backend.z52da5wt.xyz/comment/api/756

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant