Добавлены модели товаров и корзины для оптовиков, реализованы соответствующие мутации и запросы в GraphQL. Обновлен API для загрузки файлов с учетом новых типов данных. Улучшена обработка ошибок и добавлены новые функции для работы с категориями товаров.

This commit is contained in:
Bivekich
2025-07-17 16:36:07 +03:00
parent 6a94d51032
commit f377fbab5f
21 changed files with 3958 additions and 34 deletions

View File

@ -77,6 +77,34 @@ export const GET_MY_SUPPLIES = gql`
}
`
export const GET_MY_PRODUCTS = gql`
query GetMyProducts {
myProducts {
id
name
article
description
price
quantity
category {
id
name
}
brand
color
size
weight
dimensions
material
images
mainImage
isActive
createdAt
updatedAt
}
}
`
// Запросы для контрагентов
export const SEARCH_ORGANIZATIONS = gql`
query SearchOrganizations($type: OrganizationType, $search: String) {
@ -300,4 +328,112 @@ export const GET_CONVERSATIONS = gql`
updatedAt
}
}
`
export const GET_CATEGORIES = gql`
query GetCategories {
categories {
id
name
createdAt
updatedAt
}
}
`
export const GET_ALL_PRODUCTS = gql`
query GetAllProducts($search: String, $category: String) {
allProducts(search: $search, category: $category) {
id
name
article
description
price
quantity
category {
id
name
}
brand
color
size
weight
dimensions
material
images
mainImage
isActive
createdAt
updatedAt
organization {
id
inn
name
fullName
type
address
phones
emails
users {
id
avatar
managerName
}
}
}
}
`
export const GET_MY_CART = gql`
query GetMyCart {
myCart {
id
totalPrice
totalItems
items {
id
quantity
totalPrice
isAvailable
availableQuantity
createdAt
updatedAt
product {
id
name
article
description
price
quantity
brand
color
size
images
mainImage
isActive
category {
id
name
}
organization {
id
inn
name
fullName
type
address
phones
emails
users {
id
avatar
managerName
}
}
}
}
createdAt
updatedAt
}
}
`