all authors api
This commit is contained in:
@@ -152,3 +152,7 @@ def author_unfollow(user, slug):
|
|||||||
else:
|
else:
|
||||||
session.delete(flw)
|
session.delete(flw)
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
|
@query.field("authorsAll")
|
||||||
|
def get_authors_all(_, info):
|
||||||
|
return UserStorage.get_all_users()
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ type Query {
|
|||||||
userFollowedCommunities(slug: String!): [Community]!
|
userFollowedCommunities(slug: String!): [Community]!
|
||||||
userReactedShouts(slug: String!): [Shout]! # test
|
userReactedShouts(slug: String!): [Shout]! # test
|
||||||
getUserRoles(slug: String!): [Role]!
|
getUserRoles(slug: String!): [Role]!
|
||||||
|
authorsAll: [User]!
|
||||||
|
|
||||||
# shouts
|
# shouts
|
||||||
getShoutBySlug(slug: String!): Shout!
|
getShoutBySlug(slug: String!): Shout!
|
||||||
|
|||||||
@@ -22,6 +22,12 @@ class UserStorage:
|
|||||||
async with self.lock:
|
async with self.lock:
|
||||||
return self.users.get(id)
|
return self.users.get(id)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
async def get_all_users():
|
||||||
|
self = UserStorage
|
||||||
|
async with self.lock:
|
||||||
|
return self.users
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
async def get_user_by_slug(slug):
|
async def get_user_by_slug(slug):
|
||||||
self = UserStorage
|
self = UserStorage
|
||||||
|
|||||||
Reference in New Issue
Block a user