fix-topic

This commit is contained in:
tonyrewin 2022-11-19 16:18:17 +03:00
parent 56a1467d3c
commit abfbb68ac3
2 changed files with 11 additions and 11 deletions

View File

@ -117,8 +117,8 @@ input TopicInput {
title: String title: String
body: String body: String
pic: String pic: String
children: [String] # children: [String]
parents: [String] # parents: [String]
} }
input ReactionInput { input ReactionInput {

View File

@ -17,15 +17,15 @@ class TopicStorage:
print("[zine.topics] %d precached" % len(self.topics.keys())) print("[zine.topics] %d precached" % len(self.topics.keys()))
@staticmethod # @staticmethod
def load_parents(topic): # def load_parents(topic):
self = TopicStorage # self = TopicStorage
parents = [] # parents = []
for parent in self.topics.values(): # for parent in self.topics.values():
if topic.slug in parent.children: # if topic.slug in parent.children:
parents.append(parent.slug) # parents.append(parent.slug)
topic.parents = parents # topic.parents = parents
return topic # return topic
@staticmethod @staticmethod
async def get_topics_all(): async def get_topics_all():