'Approve a link or comment.
If the thing was removed, it will be re-inserted into appropriate
listings. Any reports on the approved thing will be discarded.
See also: [/api/remove](#POST_api_remove).'

@require_oauth2_scope('modposts')
@noresponse(VUser(), VModhash(), VSrCanBan('id'), thing=VByName('id'))
@api_doc(api_section.moderation)
def POST_approve(self, thing):

    if (not thing):
        return
    if thing._deleted:
        return
    if c.user._spam:
        self.abort403()
    VNotInTimeout().run(target=thing)
    kw = {'target': thing}
    if thing._spam:
        kw['details'] = 'unspam'
        train_spam = True
        insert = True
    else:
        kw['details'] = 'confirm_ham'
        train_spam = False
        insert = False
    admintools.unspam(thing, moderator_unbanned=(not c.user_is_admin), unbanner=c.user.name, train_spam=train_spam, insert=insert)
    if isinstance(thing, (Link, Comment)):
        sr = thing.subreddit_slow
        action = ('approve' + thing.__class__.__name__.lower())
        ModAction.create(sr, c.user, action, **kw)
    if (isinstance(thing, Comment) and insert):
        queries.renotify(thing)
