feat(message_feedback): add content argument to feedback creation (#12077)
Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
parent
2b2263a349
commit
5d04638091
1 changed files with 8 additions and 1 deletions
|
|
@ -105,10 +105,17 @@ class MessageFeedbackApi(WebApiResource):
|
||||||
|
|
||||||
parser = reqparse.RequestParser()
|
parser = reqparse.RequestParser()
|
||||||
parser.add_argument("rating", type=str, choices=["like", "dislike", None], location="json")
|
parser.add_argument("rating", type=str, choices=["like", "dislike", None], location="json")
|
||||||
|
parser.add_argument("content", type=str, location="json", default=None)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
MessageService.create_feedback(app_model, message_id, end_user, args.get("rating"), args.get("content"))
|
MessageService.create_feedback(
|
||||||
|
app_model=app_model,
|
||||||
|
message_id=message_id,
|
||||||
|
user=end_user,
|
||||||
|
rating=args.get("rating"),
|
||||||
|
content=args.get("content"),
|
||||||
|
)
|
||||||
except services.errors.message.MessageNotExistsError:
|
except services.errors.message.MessageNotExistsError:
|
||||||
raise NotFound("Message Not Exists.")
|
raise NotFound("Message Not Exists.")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue