Link Search Menu Expand Document

Update

/api/v2/highlight/update

Post

stories

profiles

jwt


Purpose

To allow a user to update an existing highlight of stories on his/her profile.

Body Content [input]

{
    uid: string,
    highlightID: string,
    name: string,
    icon: string,
    stories: string[],
    visibility: string
}

Returns if valid [output]

{
    message: string,
    error: 0
}

What the API does

  • Validates the value of the visibility field passed to make sure that its value is either public, followers, none or one among the accessIDs found in the access_groups field in the record corresponding to that of the uid passed from the profiles collection [400].
  • Loops through each of the values of the stories field and guarantees that there is a story with that storyID inside of the stories collection [404] and which has the same uid as that passed [403].
  • Finds the profile of the record corresponding to the uid passed from the profiles collection and updates and saves the object corresponding to the highlightID passed [404] with the updated values of the name, icon, storiesID and/or visibility fields passed.