Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(search): remove tranform using history query (#1755)

teo4b66165f97e1
diff --git a/js/app/packages/queries/history/history.ts b/js/app/packages/queries/history/history.ts
index 60c5db15a8..46da6271eb 100644
--- a/js/app/packages/queries/history/history.ts
+++ b/js/app/packages/queries/history/history.ts
@@ -57,7 +57,7 @@ export function setHistoryItemName(itemId: string, name: string) {
}));
}
-const historyQueryOptions = queryOptions({
+export const historyQueryOptions = queryOptions({
queryKey: historyKeys.list.queryKey,
queryFn: async (): Promise<HistoryQueryFnResult> => {
const result = await throwOnErr(
diff --git a/js/app/packages/queries/soup/transform-utils.ts b/js/app/packages/queries/soup/transform-utils.ts
index 0647fcc981..3f28bcfdeb 100644
--- a/js/app/packages/queries/soup/transform-utils.ts
+++ b/js/app/packages/queries/soup/transform-utils.ts
@@ -20,7 +20,6 @@ import type {
EmailEntity,
ChannelEntity,
} from '@entity';
-import { useHistoryQuery } from '@queries/history/history';
import type { ChannelType } from '@service-comms/generated/models';
import type {
DocumentSearchResult,
@@ -165,8 +164,6 @@ export const useSearchResponseItemMapper = () => {
const channelsContext = useChannelsContext();
const channels = channelsContext.channels;
- const historyQuery = useHistoryQuery();
-
return (
result: UnifiedSearchResponseItem,
searchQuery: string
@@ -241,19 +238,10 @@ export const useSearchResponseItemMapper = () => {
const search = getSearchData({
results: result.chat_search_results,
});
- let name = result.name;
- if (!name || name === blockNameToDefaultFile('chat')) {
- const chat = (historyQuery.data ?? []).find(
- (item) => item.id === result.chat_id
- );
- if (chat) {
- name = chat.name;
- }
- }
return {
type: 'chat',
id: result.chat_id,
- name,
+ name: result.name,
ownerId: result.user_id,
createdAt: result.metadata?.created_at,
updatedAt: result.metadata?.updated_at,