From 4f57686364dc75ca2e5be4978ce6295bbc7e9a54 Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev <572431+veikab@users.noreply.github.com> Date: Wed, 7 Jan 2026 16:16:45 +0700 Subject: [PATCH] fix(ai): use LangServe message format (type instead of role) --- app/pages/clientarea/addresses/[uuid].vue | 332 ++++++++++++++++++ app/pages/clientarea/addresses/index.vue | 32 +- app/pages/clientarea/ai/index.vue | 2 +- .../team/teams/UpdateTeamAddress.graphql | 15 + i18n/locales/en/profileAddresses.json | 10 +- i18n/locales/ru/profileAddresses.json | 10 +- 6 files changed, 374 insertions(+), 27 deletions(-) create mode 100644 app/pages/clientarea/addresses/[uuid].vue create mode 100644 graphql/operations/team/teams/UpdateTeamAddress.graphql diff --git a/app/pages/clientarea/addresses/[uuid].vue b/app/pages/clientarea/addresses/[uuid].vue new file mode 100644 index 0000000..72cedf3 --- /dev/null +++ b/app/pages/clientarea/addresses/[uuid].vue @@ -0,0 +1,332 @@ + + + + + diff --git a/app/pages/clientarea/addresses/index.vue b/app/pages/clientarea/addresses/index.vue index 0d94e35..a9f3384 100644 --- a/app/pages/clientarea/addresses/index.vue +++ b/app/pages/clientarea/addresses/index.vue @@ -25,32 +25,17 @@ - -
-
+ + +
{{ addr.name }} - - - {{ addr.address }} - -
- {{ isoToEmoji(addr.countryCode) }} -
-
-
+ +
@@ -79,7 +64,6 @@ const { items, isLoading, itemsWithCoords, - deleteAddress, isoToEmoji, init } = useTeamAddresses() diff --git a/app/pages/clientarea/ai/index.vue b/app/pages/clientarea/ai/index.vue index 206fd69..4503e2d 100644 --- a/app/pages/clientarea/ai/index.vue +++ b/app/pages/clientarea/ai/index.vue @@ -87,7 +87,7 @@ const handleSend = async () => { const body = { input: { messages: chat.value.map((m) => ({ - role: m.role === 'assistant' ? 'assistant' : 'user', + type: m.role === 'assistant' ? 'ai' : 'human', content: m.content })) } diff --git a/graphql/operations/team/teams/UpdateTeamAddress.graphql b/graphql/operations/team/teams/UpdateTeamAddress.graphql new file mode 100644 index 0000000..46b77de --- /dev/null +++ b/graphql/operations/team/teams/UpdateTeamAddress.graphql @@ -0,0 +1,15 @@ +mutation UpdateTeamAddress($input: UpdateTeamAddressInput!) { + updateTeamAddress(input: $input) { + success + message + address { + uuid + name + address + latitude + longitude + countryCode + isDefault + } + } +} diff --git a/i18n/locales/en/profileAddresses.json b/i18n/locales/en/profileAddresses.json index b9b06db..7872de8 100644 --- a/i18n/locales/en/profileAddresses.json +++ b/i18n/locales/en/profileAddresses.json @@ -6,10 +6,12 @@ "actions": { "add": "Add address", "confirm_delete": "Delete this address?", - "delete": "Delete" + "delete": "Delete", + "deleting": "Deleting..." }, "form": { "title": "New address", + "title_edit": "Edit address", "name": { "label": "Name", "placeholder": "e.g. Office, Warehouse, Production" @@ -28,6 +30,8 @@ }, "save": "Save", "saving": "Saving...", + "update": "Update", + "updating": "Updating...", "mapLabel": "Select a point on the map" }, "states": { @@ -41,6 +45,10 @@ "cta": "Add first address", "title": "No addresses" }, + "error": { + "not_found": "Address not found", + "back_to_list": "Back to addresses" + }, "status": {} } } diff --git a/i18n/locales/ru/profileAddresses.json b/i18n/locales/ru/profileAddresses.json index 1612ddb..5b14319 100644 --- a/i18n/locales/ru/profileAddresses.json +++ b/i18n/locales/ru/profileAddresses.json @@ -6,10 +6,12 @@ "actions": { "add": "Добавить адрес", "delete": "Удалить", + "deleting": "Удаление...", "confirm_delete": "Удалить этот адрес?" }, "form": { "title": "Новый адрес", + "title_edit": "Редактирование адреса", "mapLabel": "Выберите точку на карте", "name": { "label": "Название", @@ -28,7 +30,9 @@ "placeholder": "37.6173" }, "save": "Сохранить", - "saving": "Сохранение..." + "saving": "Сохранение...", + "update": "Обновить", + "updating": "Обновление..." }, "states": { "loading": "Загружаем адреса..." @@ -41,6 +45,10 @@ "description": "У вас пока нет сохранённых адресов", "cta": "Добавить первый адрес" }, + "error": { + "not_found": "Адрес не найден", + "back_to_list": "Назад к адресам" + }, "status": {} } }