feat: refine codex live chat flow
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
import type { FastifyInstance } from 'fastify';
|
||||
import { z } from 'zod';
|
||||
import { getAppConfig, getChatTypesConfig, upsertAppConfig, upsertChatTypesConfig } from '../services/app-config-service.js';
|
||||
import {
|
||||
getAppConfig,
|
||||
getChatTypesConfig,
|
||||
normalizeAppConfigSnapshot,
|
||||
upsertAppConfig,
|
||||
upsertChatTypesConfig,
|
||||
} from '../services/app-config-service.js';
|
||||
import { getAutomationTypesConfig, upsertAutomationTypesConfig } from '../services/automation-type-config-service.js';
|
||||
|
||||
export async function registerAppConfigRoutes(app: FastifyInstance) {
|
||||
@@ -9,7 +15,7 @@ export async function registerAppConfigRoutes(app: FastifyInstance) {
|
||||
|
||||
return {
|
||||
ok: true,
|
||||
config: config ?? {},
|
||||
config: normalizeAppConfigSnapshot(config),
|
||||
};
|
||||
});
|
||||
|
||||
@@ -115,7 +121,7 @@ export async function registerAppConfigRoutes(app: FastifyInstance) {
|
||||
|
||||
return {
|
||||
ok: true,
|
||||
config: savedConfig,
|
||||
config: normalizeAppConfigSnapshot(savedConfig),
|
||||
};
|
||||
} catch (error) {
|
||||
return reply.code(409).send({
|
||||
|
||||
Reference in New Issue
Block a user