Beispiel #1
0
def restore():
	thread = request.json.get('thread')

	postList = get_post_list(thread=thread)
	for post in postList:
		restore_post(post['id'])

	db.execute("""UPDATE Thread SET isDeleted = 0, posts = %(posts)s WHERE thread = %(thread)s;""",
			   {'posts': len(postList), 'thread': thread}, True)

	return json.dumps({"code": 0, "response": thread}, indent=4)
Beispiel #2
0
def restore():
    requestBody = request.json

    postID = requestBody.get('post')
    post = get_post_by_id(postID)
    threadID = post['thread']

    restore_post(postID)
    inc_posts_for_thread(threadID)

    return json.dumps({"code": 0, "response": {"post": postID}}, indent=4)
Beispiel #3
0
def restore():
	requestBody = request.json

	postID = requestBody.get('post')
	post = get_post_by_id(postID)
	threadID = post['thread']

	restore_post(postID)
	inc_posts_for_thread(threadID)

	return json.dumps({"code": 0, "response": {"post": postID}}, indent=4)