Skip to content

Commit

Permalink
Fixed the Gemini response with the help of .replace in js
Browse files Browse the repository at this point in the history
  • Loading branch information
MeetDOD committed Oct 7, 2024
1 parent 997aea6 commit dba680c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/src/routes/post/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,8 @@ export const aiCustomization = async (req: UserAuthRequest, res: Response) => {
const cssResponse = await cssResult.response;
const jsResponse = await jsResult.response;

const cssText = cssResponse.text();
const jsText = jsResponse.text();
const cssText = cssResponse.text().replace('```html','').replace('```','');
const jsText = jsResponse.text().replace('```javascript','').replace('```','');

res.json({ css: cssText, js: jsText });

Expand Down

0 comments on commit dba680c

Please sign in to comment.