コード例 #1
0
ファイル: adminajax.py プロジェクト: Texo/texo-cms
def ajaxDeletePost(postId):
	try:
		if not postId:
			return httpservice.badRequest(response=response)

		postservice.deletePost(postId=postId)

	except Exception as e:
		return httpservice.error(response=response, message=e.message)

	return { "message": "Post deleted successfully!" }
コード例 #2
0
ファイル: adminajax.py プロジェクト: Texo/texo-cms
def ajaxArchivePost(postId):
	try:
		if not postId:
			return httpservice.badRequest(response=response)

		numAffected = postservice.archivePost(postId=postId)
		if numAffected <= 0:
			return httpservice.noFound(response=response)

	except Exception as e:
		return httpservice.error(response=response, message=e.message)

	return { "message": "Post archived successfully!" }