Add
/api/v2/verified/add
Post
verifieds
users
notifications
Purpose
To allow the admin to add a user as verified.
Body Content [input]
{
secret: string,
membersID: string[]
}
Returns if valid [output]
{
message: string,
error: 0
}
What the API does
- Checks if the value of the
secret
field passed is valid [401]. - Checks that
membersID
is not empty [400] and loops through each of its values to ensure that there is a correponding record in theprofiles
collection with these values [404]. - Adds a new record in the
verifieds
collection with auid
field corresponding to the value of the items in themembersID
field passed. - Loops through each value present in the
membersID
field passed and generates a newnotificationID
and atimestamp
corresponding to the current date and time, and creates a new object in thenotifications
collection with the following data :{ uid: loop_value, notificationID: notificationID, content: `Your account has been verified! 😃`, profileID: '_system', type: "verified", created_on: timestamp, read: false, redirect: `/profile/` }