diff --git a/apps/web/actions/contacts.ts b/apps/web/actions/contacts.ts
index 51d5660..6815c9e 100644
--- a/apps/web/actions/contacts.ts
+++ b/apps/web/actions/contacts.ts
@@ -1,71 +1,21 @@
'use server';
-
-export type Contact = {
- avatarUrl: string;
- id: string;
- name: string;
- status: 'client' | 'master';
-};
-
-// Имитация базы данных
-const contacts: Contact[] = [
- {
- avatarUrl: '/placeholder.svg?height=40&width=40',
- id: '1',
- name: 'Иван Иванов',
- status: 'client',
- },
- {
- avatarUrl: '/placeholder.svg?height=40&width=40',
- id: '2',
- name: 'Петр Петров',
- status: 'master',
- },
- {
- avatarUrl: '/placeholder.svg?height=40&width=40',
- id: '3',
- name: 'Анна Сидорова',
- status: 'client',
- },
- {
- avatarUrl: '/placeholder.svg?height=40&width=40',
- id: '4',
- name: 'Мария Кузнецова',
- status: 'master',
- },
- {
- avatarUrl: '/placeholder.svg?height=40&width=40',
- id: '5',
- name: 'Алексей Петров',
- status: 'client',
- },
- {
- avatarUrl: '/placeholder.svg?height=40&width=40',
- id: '6',
- name: 'Иван Иванов',
- status: 'master',
- },
- {
- avatarUrl: '/placeholder.svg?height=40&width=40',
- id: '7',
- name: 'Петр Петров',
- status: 'client',
- },
- {
- avatarUrl: '/placeholder.svg?height=40&width=40',
- id: '8',
- name: 'Анна Сидорова',
- status: 'master',
- },
- {
- avatarUrl: '/placeholder.svg?height=40&width=40',
- id: '9',
- name: 'Мария Кузнецова',
- status: 'client',
- },
-] as const;
+import { authOptions } from '@/config/auth';
+import { getCustomerClients, getCustomerMasters } from '@repo/graphql/api';
+import { getServerSession } from 'next-auth/next';
export async function getContacts() {
- // В реальном приложении здесь был бы запрос к базе данных
- return contacts;
+ const session = await getServerSession(authOptions);
+
+ if (session) {
+ const { user } = session;
+ const getCustomerMastersResponse = await getCustomerMasters({ telegramId: user?.telegramId });
+ const getCustomerClientsResponse = await getCustomerClients({ telegramId: user?.telegramId });
+
+ return {
+ clients: getCustomerClientsResponse?.clients,
+ masters: getCustomerMastersResponse?.masters,
+ };
+ }
+
+ return null;
}
diff --git a/apps/web/components/contacts/contacts-list.tsx b/apps/web/components/contacts/contacts-list.tsx
index 579f356..c483125 100644
--- a/apps/web/components/contacts/contacts-list.tsx
+++ b/apps/web/components/contacts/contacts-list.tsx
@@ -1,27 +1,26 @@
-/* eslint-disable promise/prefer-await-to-then */
'use client';
-import { type Contact, getContacts } from '@/actions/contacts';
-import { ContactsFilterContext } from '@/context/contacts-filter';
+import { useCustomerContacts } from '@/hooks/contacts';
+import * as GQL from '@repo/graphql/types';
import { Avatar, AvatarFallback, AvatarImage } from '@repo/ui/components/ui/avatar';
import Link from 'next/link';
-import { memo, use, useEffect, useMemo, useState } from 'react';
+import { memo } from 'react';
type ContactRowProps = {
- readonly contact: Contact;
+ readonly contact: GQL.CustomerFieldsFragment;
};
const ContactRow = memo(function ({ contact }: ContactRowProps) {
return (
-
+
-
+
{contact.name.charAt(0)}
{contact.name}
- {contact.status === 'client' ? 'Клиент' : 'Мастер'}
+ {contact.role === GQL.Enum_Customer_Role.Client ? 'Клиент' : 'Мастер'}
@@ -30,24 +29,12 @@ const ContactRow = memo(function ({ contact }: ContactRowProps) {
});
export function ContactsList() {
- const [contacts, setContacts] = useState([]);
- const { filter } = use(ContactsFilterContext);
-
- useEffect(() => {
- getContacts().then(setContacts);
- }, []);
-
- const filteredContacts = useMemo(() => {
- if (filter === 'all') return contacts;
- if (filter === 'clients') return contacts.filter((contact) => contact.status === 'client');
- if (filter === 'masters') return contacts.filter((contact) => contact.status === 'master');
- return contacts;
- }, [contacts, filter]);
+ const { contacts } = useCustomerContacts();
return (
- {filteredContacts.map((contact) => (
-
+ {contacts.map((contact) => (
+
))}
);
diff --git a/apps/web/hooks/contacts/index.ts b/apps/web/hooks/contacts/index.ts
new file mode 100644
index 0000000..59a9b65
--- /dev/null
+++ b/apps/web/hooks/contacts/index.ts
@@ -0,0 +1 @@
+export * from './use-customer-contacts';
diff --git a/apps/web/hooks/contacts/use-customer-contacts.ts b/apps/web/hooks/contacts/use-customer-contacts.ts
new file mode 100644
index 0000000..dadc8f4
--- /dev/null
+++ b/apps/web/hooks/contacts/use-customer-contacts.ts
@@ -0,0 +1,43 @@
+/* eslint-disable promise/prefer-await-to-then */
+'use client';
+import { getContacts } from '@/actions/contacts';
+import { ContactsFilterContext } from '@/context/contacts-filter';
+import type * as GQL from '@repo/graphql/types';
+import { sift } from 'radash';
+import { use, useEffect, useMemo, useState } from 'react';
+
+type Clients = NonNullable['clients'];
+type Masters = NonNullable['masters'];
+
+export function useCustomerContacts() {
+ const [contacts, setContacts] = useState<{ clients: Clients; masters: Masters }>({
+ clients: [],
+ masters: [],
+ });
+
+ const { filter } = use(ContactsFilterContext);
+
+ useEffect(() => {
+ getContacts().then((response) => {
+ setContacts({
+ clients: response?.clients || [],
+ masters: response?.masters || [],
+ });
+ });
+ }, []);
+
+ const filteredContacts = useMemo(() => {
+ const { clients, masters } = contacts;
+
+ switch (filter) {
+ case 'clients':
+ return sift(clients);
+ case 'masters':
+ return sift(masters);
+ default:
+ return [...sift(clients), ...sift(masters)];
+ }
+ }, [contacts, filter]);
+
+ return { contacts: filteredContacts };
+}
diff --git a/apps/web/package.json b/apps/web/package.json
index 1a1dc15..aa7ffae 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -22,6 +22,7 @@
"next-auth": "^4.24.11",
"next-intl": "^3.26.0",
"next-themes": "^0.4.4",
+ "radash": "^12.1.0",
"react": "catalog:",
"react-dom": "catalog:",
"use-debounce": "^10.0.4",
diff --git a/packages/graphql/api/customer.ts b/packages/graphql/api/customer.ts
index fb2e2a3..352735e 100644
--- a/packages/graphql/api/customer.ts
+++ b/packages/graphql/api/customer.ts
@@ -38,9 +38,29 @@ export async function getCustomer(input: GQL.GetCustomerQueryVariables) {
variables: input,
});
- const customer = response?.data?.customers?.at(0);
+ return response?.data?.customers?.at(0);
+}
- return customer;
+export async function getCustomerMasters(input: GQL.GetCustomerMastersQueryVariables) {
+ const { query } = await getClientWithToken();
+
+ const response = await query({
+ query: GQL.GetCustomerMastersDocument,
+ variables: input,
+ });
+
+ return response?.data?.customers?.at(0);
+}
+
+export async function getCustomerClients(input: GQL.GetCustomerClientsQueryVariables) {
+ const { query } = await getClientWithToken();
+
+ const response = await query({
+ query: GQL.GetCustomerClientsDocument,
+ variables: input,
+ });
+
+ return response?.data?.customers?.at(0);
}
type AddCustomerMasterInput = Pick & {
diff --git a/packages/graphql/operations/customer.graphql b/packages/graphql/operations/customer.graphql
index 209cbdd..b3868cf 100644
--- a/packages/graphql/operations/customer.graphql
+++ b/packages/graphql/operations/customer.graphql
@@ -21,7 +21,12 @@ query GetCustomer($phone: String, $telegramId: Long) {
}
query GetCustomerMasters($phone: String, $telegramId: Long) {
- customers(filters: { or: [{ phone: { eq: $phone } }, { telegramId: { eq: $telegramId } }] }) {
+ customers(
+ filters: {
+ or: [{ phone: { eq: $phone } }, { telegramId: { eq: $telegramId } }]
+ and: [{ active: { eq: true } }]
+ }
+ ) {
documentId
masters {
...CustomerFields
@@ -29,6 +34,20 @@ query GetCustomerMasters($phone: String, $telegramId: Long) {
}
}
+query GetCustomerClients($phone: String, $telegramId: Long) {
+ customers(
+ filters: {
+ or: [{ phone: { eq: $phone } }, { telegramId: { eq: $telegramId } }]
+ and: [{ active: { eq: true } }]
+ }
+ ) {
+ documentId
+ clients {
+ ...CustomerFields
+ }
+ }
+}
+
mutation UpdateCustomerProfile($documentId: ID!, $data: CustomerInput!) {
updateCustomer(documentId: $documentId, data: $data) {
...CustomerFields
diff --git a/packages/graphql/types/operations.generated.ts b/packages/graphql/types/operations.generated.ts
index cde454c..3676a73 100644
--- a/packages/graphql/types/operations.generated.ts
+++ b/packages/graphql/types/operations.generated.ts
@@ -594,6 +594,14 @@ export type GetCustomerMastersQueryVariables = Exact<{
export type GetCustomerMastersQuery = { __typename?: 'Query', customers: Array<{ __typename?: 'Customer', documentId: string, masters: Array<{ __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: any | null | undefined } | null | undefined> } | null | undefined> };
+export type GetCustomerClientsQueryVariables = Exact<{
+ phone?: InputMaybe;
+ telegramId?: InputMaybe;
+}>;
+
+
+export type GetCustomerClientsQuery = { __typename?: 'Query', customers: Array<{ __typename?: 'Customer', documentId: string, clients: Array<{ __typename?: 'Customer', active?: boolean | null | undefined, documentId: string, name: string, phone: string, photoUrl?: string | null | undefined, role: Enum_Customer_Role, telegramId?: any | null | undefined } | null | undefined> } | null | undefined> };
+
export type UpdateCustomerProfileMutationVariables = Exact<{
documentId: Scalars['ID']['input'];
data: CustomerInput;
@@ -607,5 +615,6 @@ export const RegisterDocument = {"kind":"Document","definitions":[{"kind":"Opera
export const LoginDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"Login"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"identifier"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"password"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"login"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"identifier"},"value":{"kind":"Variable","name":{"kind":"Name","value":"identifier"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"password"},"value":{"kind":"Variable","name":{"kind":"Name","value":"password"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"jwt"}}]}}]}}]} as unknown as DocumentNode;
export const CreateCustomerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateCustomer"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Long"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"phone"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createCustomer"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"telegramId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"phone"},"value":{"kind":"Variable","name":{"kind":"Name","value":"phone"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"role"},"value":{"kind":"EnumValue","value":"client"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}}]}}]}}]} as unknown as DocumentNode;
export const GetCustomerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCustomer"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"phone"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Long"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customers"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"or"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"phone"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"phone"}}}]}}]},{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"telegramId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}}}]}}]}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CustomerFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Customer"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"telegramId"}}]}}]} as unknown as DocumentNode;
-export const GetCustomerMastersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCustomerMasters"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"phone"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Long"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customers"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"or"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"phone"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"phone"}}}]}}]},{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"telegramId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}}}]}}]}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"masters"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CustomerFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Customer"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"telegramId"}}]}}]} as unknown as DocumentNode;
+export const GetCustomerMastersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCustomerMasters"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"phone"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Long"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customers"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"or"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"phone"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"phone"}}}]}}]},{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"telegramId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}}}]}}]}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"and"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"active"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"BooleanValue","value":true}}]}}]}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"masters"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CustomerFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Customer"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"telegramId"}}]}}]} as unknown as DocumentNode;
+export const GetCustomerClientsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCustomerClients"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"phone"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Long"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customers"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"or"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"phone"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"phone"}}}]}}]},{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"telegramId"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"telegramId"}}}]}}]}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"and"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"active"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"BooleanValue","value":true}}]}}]}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"clients"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CustomerFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Customer"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"telegramId"}}]}}]} as unknown as DocumentNode;
export const UpdateCustomerProfileDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateCustomerProfile"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"documentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CustomerInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateCustomer"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"documentId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"documentId"}}},{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"data"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CustomerFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CustomerFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Customer"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"active"}},{"kind":"Field","name":{"kind":"Name","value":"documentId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"phone"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"telegramId"}}]}}]} as unknown as DocumentNode;
\ No newline at end of file
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index acb3ae4..5b94b1d 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -162,6 +162,9 @@ importers:
next-themes:
specifier: ^0.4.4
version: 0.4.4(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
+ radash:
+ specifier: ^12.1.0
+ version: 12.1.0
react:
specifier: 'catalog:'
version: 19.0.0
@@ -5203,6 +5206,10 @@ packages:
queue-microtask@1.2.3:
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
+ radash@12.1.0:
+ resolution: {integrity: sha512-b0Zcf09AhqKS83btmUeYBS8tFK7XL2e3RvLmZcm0sTdF1/UUlHSsjXdCcWNxe7yfmAlPve5ym0DmKGtTzP6kVQ==}
+ engines: {node: '>=14.18.0'}
+
rambda@7.5.0:
resolution: {integrity: sha512-y/M9weqWAH4iopRd7EHDEQQvpFPHj1AA3oHozE9tfITHUtTR7Z9PSlIRRG2l1GuW7sefC1cXFfIcF+cgnShdBA==}
@@ -11887,6 +11894,8 @@ snapshots:
queue-microtask@1.2.3: {}
+ radash@12.1.0: {}
+
rambda@7.5.0: {}
ramda@0.30.1: {}