diff --git a/packages/core.gbapp/services/GBSSR.ts b/packages/core.gbapp/services/GBSSR.ts index 3da13a76..3d508761 100644 --- a/packages/core.gbapp/services/GBSSR.ts +++ b/packages/core.gbapp/services/GBSSR.ts @@ -38,7 +38,7 @@ import { createRequire } from 'module'; const require = createRequire(import.meta.url); import path from 'path'; -import fs from 'fs/promises'; +import fs from 'fs/promises'; import { NextFunction, Request, Response } from 'express'; import urljoin from 'url-join'; import { GBMinInstance } from 'botlib'; @@ -110,7 +110,7 @@ export class GBSSR { const file = await fs.readFile(preferences, 'utf8'); const data = JSON.parse(file); data['profile']['exit_type'] = 'none'; - await fs.writeFile(preferences, JSON.stringify(data)); + await fs.writeFile(preferences, JSON.stringify(data)); } } @@ -308,7 +308,7 @@ export class GBSSR { // Checks if the bot has an .gbui published or use default.gbui. if (!await GBUtil.exists(packagePath)) { - packagePath = GBUtil.getGBAIPath(minBoot.botId, `gbui`); + packagePath = path.join(process.env.PWD, 'packages', `default.gbui`); } let parts = req.url.replace(`/${botId}`, '').split('?'); let url = parts[0]; @@ -344,12 +344,11 @@ export class GBSSR { html = html.replace(/\{p\}/gi, min.botId); html = html.replace(/\{botId\}/gi, min.botId); - const theme = - `theme-${ - await (min.core as any)['getParam'](min.instance, 'Theme Color','grey' )}`; - + const theme = + `theme-${await (min.core as any)['getParam'](min.instance, 'Theme Color', 'grey')}`; + html = html.replace(/\{themeColor\}/gi, theme); - + html = html.replace(/\{theme\}/gi, min.instance.theme ? min.instance.theme : 'default.gbtheme'); html = html.replace(/\{title\}/gi, min.instance.title); diff --git a/templates/edu.gbai/edu.gbdialog/enrollment.bas b/templates/edu.gbai/edu.gbdialog/enrollment.bas index ef60f31f..19579157 100644 --- a/templates/edu.gbai/edu.gbdialog/enrollment.bas +++ b/templates/edu.gbai/edu.gbdialog/enrollment.bas @@ -6,5 +6,4 @@ PARAM address AS string LIKE "Rua das Flores, 123, São Paulo, SP" DESCRIPTION " DESCRIPTION "This is a the enrollment process, called when the user wants to enrol. Once all information is collected, confirm the details and inform them that their enrollment request has been successfully submitted. Provide a polite and professional tone throughout the interaction." -SAVE "enrollments.csv", id, name, birthday, email, personalid, address - \ No newline at end of file +SAVE "enrollments.csv", id, name, birthday, email, personalid, address \ No newline at end of file