Ver Fonte

fix sheet

ming há 3 anos atrás
pai
commit
b59dcfe115
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      api/main.py

+ 2 - 2
api/main.py

@@ -105,7 +105,7 @@ class Course(BaseModel):
 
 class Email_tag(BaseModel):
     email:str
-    tags:int[]
+    tags:str
 
 @app.post("/get_courses_by_cid")
 async def get_courses(cids:List[int]):
@@ -194,7 +194,7 @@ async def email_interest(email_tag:Email_tag):
     db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/openTalk?charset=utf8mb4')
     email_table = db['interest_email']
     
-    for tag in email_tag.tags:
+    for tag in email_tag.tags.split(','):
         email_table.insert({'email':tag.name,'interest_tag':tag})
     x = threading.Thread(target=to_sheet)
     x.start()