This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async getWithPagination(params: IGetArticlesParamsRepo = {}): Promise<IGetArticlesWithPaginationRepo> { | |
| const { page = 1, limit = 12 } = params; | |
| const offset = (page - 1) * limit; | |
| // Получаем общее количество статей | |
| const totalResult = await db | |
| .select({ count: count() }) | |
| .from(ArticleSchema); | |
| const total = Number(totalResult[0]?.count || 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { StatusChip } from "@helium10/re-ui-components"; | |
| import type { StatusChipsType } from "@helium10/re-ui-components/src/components/chip/config"; | |
| import { useTranslation } from "@/i18n/useTranslation"; | |
| import type { PurchaseOrdersApi } from "@/requests/purchaseOrder/purchaseOrders"; | |
| type ExtractedStatuses = Extract< | |
| PurchaseOrdersApi.IStatus, | |
| "EDITING" | "RECEIVED" | "SHIPMENT_ERROR" | |
| >; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { StatusChip } from "@helium10/re-ui-components"; | |
| import type { StatusChipsType } from "@helium10/re-ui-components/src/components/chip/config"; | |
| import { useTranslation } from "@/i18n/useTranslation"; | |
| import type { PurchaseOrdersApi } from "@/requests/purchaseOrder/purchaseOrders"; | |
| const purchaseOrdersStatuses: Record<PurchaseOrdersApi.IStatus, string> = { | |
| EDITING: "editing", | |
| CONFIRMED: "confirmed", | |
| IN_TRANSIT: "inTransit", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { getMarketData, membersLink, transformHelium10Domain } from "@helium10/re-core"; | |
| export namespace Links { | |
| export const imApi = transformHelium10Domain(process.env.REACT_APP_IM_BACKEND || ""); | |
| export const ccApi = transformHelium10Domain(process.env.REACT_APP_CC_BACKEND || ""); | |
| export const profitsProduct = `${membersLink}/profits/product/view`; | |
| export const getProduct = (store?: string, asin?: string) => { | |
| if (!store || !asin) return ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { updateLinkWithAccountId } from "@helium10/re-core"; | |
| import { cssBody400, cssDisplay100Bold, NewButton } from "@helium10/re-ui-components"; | |
| import styled from "styled-components"; | |
| import { AppLinks } from "../../../core/routes"; | |
| import { useTranslation } from "../../../i18n/useTranslation"; | |
| import { salesHistoryLoaderImageSrc } from "../consts"; | |
| export const SalesHistoryLoaderNotReady = () => { | |
| const { t } = useTranslation(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // . /index page | |
| import { useEffect } from "react"; | |
| import styled from "styled-components"; | |
| import { MainHeader } from "../../features/common/layout/MainHeader"; | |
| import { SalesHistoryLoader } from "../../features/salesHistoryLoader"; | |
| import { SuppliersTable } from "../../features/suppliers"; | |
| import { useTranslation } from "../../i18n/useTranslation"; | |
| import { CheckAccessApi } from "../../requests/checkAccess"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type { ReactNode } from "react"; | |
| import { useEffect } from "react"; | |
| import { SalesHistoryLoaderNotReady } from "./components/SalesHistoryLoaderNotReady"; | |
| import { SalesHistoryLoaderProvider, useSalesHistoryLoaderFeature } from "./store/store"; | |
| export const SalesHistoryLoader = ({ children }: { children: ReactNode }) => { | |
| return ( | |
| <SalesHistoryLoaderProvider | |
| value={{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type { ITableColumn } from "@helium10/re-ui-components"; | |
| import { useMemo } from "react"; | |
| import { useTranslation } from "../../../../i18n/useTranslation"; | |
| import { SuppliersApi } from "../../../../requests/suppliers/suppliersList"; | |
| import ISupplier = SuppliersApi.ISupplier; | |
| import { AddressCell } from "../components/AddressCell"; | |
| export const useTableColumns = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type { ITableColumn } from "@helium10/re-ui-components"; | |
| import { useMemo } from "react"; | |
| import { useTranslation } from "../../../../i18n/useTranslation"; | |
| import { SuppliersApi } from "../../../../requests/suppliers/suppliersList"; | |
| import ISupplier = SuppliersApi.ISupplier; | |
| import { AddressCell } from "../components/AddressCell"; | |
| export const useTableColumns = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { getUrlWithSearchParams, membersLink, transformHelium10Domain } from "@helium10/re-core"; | |
| const helium = transformHelium10Domain(membersLink); | |
| export const subscribeLink = getUrlWithSearchParams(`${helium}/subscribe`, {}); |
NewerOlder