File "getWithArticle.ts"

Full Path: /var/www/html/gitep_front/src/entities/project/api/getWithArticle.ts
File size: 614 bytes
MIME-type: text/x-java
Charset: utf-8

import { $modelStore } from '@shared/index';
import { axiosInstance } from "@shared/api";

export const getWithArticleProject = async (articleType: string) => {
    try {
        const modelId = $modelStore.getState().model;
        if (!modelId) {
            throw new Error("modelId не задана");
        }

        const params: {article_type: string} = {
            article_type: articleType
        }

        const result = await axiosInstance.get(`article/${modelId}/with-payments`, { params });
        return result
    } catch (error) {
        console.error('getProgects error', error)
    }
}