Skip to content

Commit 78d49b3

Browse files
committed
fix: coderabbitai observations
1 parent 4781c6f commit 78d49b3

File tree

2 files changed

+18
-37
lines changed

2 files changed

+18
-37
lines changed

apps/masterbots.ai/lib/hooks/use-sidebar.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ export function SidebarProvider({ children }: SidebarProviderProps) {
156156
)
157157
if (chatbot) {
158158
setActiveChatbot(chatbot.chatbot)
159-
console.log('New chatbot', chatbot.chatbot)
160159
} else {
161160
setActiveChatbot(null)
162161
}

apps/masterbots.ai/services/hasura/hasura.service.ts

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@ import type {
3030
UpsertUserParams,
3131
} from './hasura.service.type'
3232

33+
const chatbotEnumFieldsFragment = {
34+
complexityEnum: {
35+
prompt: true,
36+
},
37+
toneEnum: {
38+
prompt: true,
39+
},
40+
lengthEnum: {
41+
prompt: true,
42+
},
43+
typeEnum: {
44+
prompt: true,
45+
},
46+
}
47+
3348
function getHasuraClient({ jwt, adminSecret, signal }: GetHasuraClientParams) {
3449
return createMbClient({
3550
config: {
@@ -62,18 +77,7 @@ export async function getCategories(userId?: string) {
6277
__scalar: true,
6378
},
6479
},
65-
complexityEnum: {
66-
prompt: true,
67-
},
68-
toneEnum: {
69-
prompt: true,
70-
},
71-
lengthEnum: {
72-
prompt: true,
73-
},
74-
typeEnum: {
75-
prompt: true,
76-
},
80+
...chatbotEnumFieldsFragment,
7781
},
7882
__scalar: true,
7983
__args: userId
@@ -270,18 +274,7 @@ export async function getThread({ threadId, jwt, signal }: Partial<GetThreadPara
270274
followerId: true,
271275
followeeIdChatbot: true,
272276
},
273-
complexityEnum: {
274-
prompt: true,
275-
},
276-
toneEnum: {
277-
prompt: true,
278-
},
279-
lengthEnum: {
280-
prompt: true,
281-
},
282-
typeEnum: {
283-
prompt: true,
284-
},
277+
...chatbotEnumFieldsFragment,
285278
},
286279
user: {
287280
username: true,
@@ -437,18 +430,7 @@ export async function getChatbot({ chatbotId, chatbotName, threads, jwt }: GetCh
437430
__scalar: true,
438431
},
439432
},
440-
complexityEnum: {
441-
prompt: true,
442-
},
443-
toneEnum: {
444-
prompt: true,
445-
},
446-
lengthEnum: {
447-
prompt: true,
448-
},
449-
typeEnum: {
450-
prompt: true
451-
},
433+
...chatbotEnumFieldsFragment,
452434
...(threads
453435
? {
454436
threads: {

0 commit comments

Comments
 (0)