diff --git a/api/gmail/token.json b/api/gmail/token.json index d993a49..273faf4 100644 --- a/api/gmail/token.json +++ b/api/gmail/token.json @@ -1 +1 @@ -{"token": "ya29.a0AfB_byD5fGsvtvgGqI8utDmKcIC9or7xvndaJf9owws9l6TuG0C1EqG4r12OpHImBgiAj2MxWkG5r6x8RIWUzZ5AZUbIeMBhyQkfP_tE8fyg_OhlbFmSnG4uDunAn30X6e-RNMGdcNVW6eJKRKxK_c2Qj3frfMvJEtgJaCgYKAZkSARMSFQHGX2MieI76xBiiowjf6zUTZ2lgzg0171", "refresh_token": "1//05MVh9l0KSdq_CgYIARAAGAUSNwF-L9IrB-R_XAMM-m5hQwiCtVyyRbLVfQReMWoQh8wEQohm--j4HNf2VmKEV2-QtpYWuUFDuxE", "token_uri": "https://oauth2.googleapis.com/token", "client_id": "124807568946-u7be2rg379v1h22u527cb90h4rcdqt2e.apps.googleusercontent.com", "client_secret": "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", "scopes": ["https://mail.google.com/"], "universe_domain": "googleapis.com", "expiry": "2024-01-13T18:55:08.653696Z"} \ No newline at end of file +{"token": "ya29.a0AfB_byCHEq94ILIOHgtzHKZZN4_0OJ-CvyeVwOZN0M-0LOuht-3HJv4SzMXOFfbAMICw5K40d7XjzgOBUeOJQJeFou2tUc-60j-vQ9aGMrkl-zDDdwa5yJDH9TkgjN4nWcrG6m5NzZqPjfSyMR1lNQyVCmxS2iw80d50aCgYKAfESARMSFQHGX2Mi1sQlEwsKkER14uOtKJD4aw0171", "refresh_token": "1//05MVh9l0KSdq_CgYIARAAGAUSNwF-L9IrB-R_XAMM-m5hQwiCtVyyRbLVfQReMWoQh8wEQohm--j4HNf2VmKEV2-QtpYWuUFDuxE", "token_uri": "https://oauth2.googleapis.com/token", "client_id": "124807568946-u7be2rg379v1h22u527cb90h4rcdqt2e.apps.googleusercontent.com", "client_secret": "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", "scopes": ["https://mail.google.com/"], "universe_domain": "googleapis.com", "expiry": "2024-01-13T20:14:28.976731Z"} \ No newline at end of file diff --git a/api/main.py b/api/main.py index 98e2ea5..9c55f00 100644 --- a/api/main.py +++ b/api/main.py @@ -50,8 +50,9 @@ def refresh_emails(): message_contents = read_message(googleapi_client, recent_message) if message_contents["read"]: continue - - gpt_feedback = get_feedback(openai_client, message_contents["text"]) + gpt_feedback = {"positive": "NR"} + if len(message_contents["text"]) != 0: + gpt_feedback = get_feedback(openai_client, message_contents["text"]) modify_post_data = { "removeLabelIds": [ @@ -66,7 +67,8 @@ def refresh_emails(): "desc": gpt_feedback["analysis"] } - update_mail(database, update_query, new_values) + if len(message_contents["text"]) != 0: + update_mail(database, update_query, new_values) @app.route("/send", methods=["POST"]) diff --git a/frontend/brebeufhx-spinich-pizza/app/dashboard/page.tsx b/frontend/brebeufhx-spinich-pizza/app/dashboard/page.tsx index c4bc9dd..ca56635 100644 --- a/frontend/brebeufhx-spinich-pizza/app/dashboard/page.tsx +++ b/frontend/brebeufhx-spinich-pizza/app/dashboard/page.tsx @@ -16,7 +16,7 @@ export default function Dashboard() { console.log(res2.data) let recipient = res2.data recipient.email = res.data.recipients[i] - setArrOfRecipients([...arrOfRecipients, recipient]) + setArrOfRecipients((arrOfRecipients: any) => [...arrOfRecipients, recipient]) } ) diff --git a/frontend/brebeufhx-spinich-pizza/app/send/page.tsx b/frontend/brebeufhx-spinich-pizza/app/send/page.tsx index 0f6f893..9e604c8 100644 --- a/frontend/brebeufhx-spinich-pizza/app/send/page.tsx +++ b/frontend/brebeufhx-spinich-pizza/app/send/page.tsx @@ -122,7 +122,7 @@ export default function Send() {