return-type-fix
Some checks failed
Deploy to core / deploy (push) Failing after 1m30s

This commit is contained in:
2024-02-03 17:31:00 +03:00
parent 18521f3fc5
commit d3b2eddf58
3 changed files with 12 additions and 7 deletions

View File

@@ -109,11 +109,13 @@ async def get_topic(_, _info, slug):
async def create_topic(_, _info, inp):
with local_session() as session:
# TODO: check user permissions to create topic for exact community
# and actor is permitted to craete it
new_topic = Topic(**inp)
session.add(new_topic)
session.commit()
return {'topic': new_topic}
return {'topic': new_topic}
return {'error': 'cannot create topic'}
@mutation.field('update_topic')
@@ -130,6 +132,7 @@ async def update_topic(_, _info, inp):
session.commit()
return {'topic': topic}
return {'error': 'cannot update' }
@mutation.field('delete_topic')
@@ -149,8 +152,7 @@ async def delete_topic(_, info, slug: str):
session.commit()
return {}
else:
return {'error': 'access denied'}
return {'error': 'access denied'}
def topic_follow(follower_id, slug):