Skip to content

Commit

Permalink
fix: revert social share api
Browse files Browse the repository at this point in the history
  • Loading branch information
baebae02 committed Nov 11, 2023
1 parent aeb8efd commit d7e9df3
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions app/api/share.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,32 @@ def post(self):
return ShareService.save_storage(content['pray_id_list'])



@share.route('/social', methods=['POST'])
@share.route('/social', methods=['GET'])
class SharePrayByLink(Resource):
@login_required
@share.expect(prayListModel)
def post(self):
@login_required
@share.expect(pray_list_encoding)
def get(self):
"""
기도제목을 공유합니다.
기도제목을 공유합니다.
"""
content = request.json
return ShareService.share_pray(content['pray_id_list'])
parsed_url = urlparse(request.url)
query_params = parse_qsl(parsed_url.query)

pray_list_encoding_str = next((val for key, val in query_params if key == 'pray_list'), None)
if pray_list_encoding_str:
prays_decoded = [int(todo) for todo in unquote(pray_list_encoding_str).split(',')]
return ShareService.share_pray(prays_decoded)


# @share.route('/social', methods=['POST'])
# class SharePrayByLink(Resource):
# @login_required
# @share.expect(prayListModel)
# def post(self):
# """
# 기도제목을 공유합니다.
# """
# content = request.json
# return ShareService.share_pray(content['pray_id_list'])


0 comments on commit d7e9df3

Please sign in to comment.