feat: integrate post AI translation with UI toggle and backend queue

This commit is contained in:
Adolfo Reyna
2026-02-25 18:41:54 -05:00
parent 9da5874977
commit c281878875
4 changed files with 72 additions and 4 deletions

7
API.js
View File

@@ -1,6 +1,6 @@
import i18n from "./i18nMessages.js";
//const baseUrl = "https://emiapi.reynafamily.com";
const baseUrl = "http://localhost:3000";
const baseUrl = "https://emiapi.reynafamily.com";
//const baseUrl = "http://localhost:3000";
const requestErrorCooldownMs = 30000;
const profileFailureCooldownMs = 60000;
const recentRequestErrors = {};
@@ -270,6 +270,9 @@ const API = {
updatePost(post){
return postCall("/post/" + post._id, {content: post.content});
},
translatePost(postid, targetLang) {
return postCall("/post/translate", { postid, targetLang });
},
newPost(content, toProfile, isNews) {
//Content is expected to be a string.
let params = { content };