fitst commit

This commit is contained in:
Samandar Turgunboyev
2026-01-28 18:26:50 +05:00
parent 166a55b1e9
commit 124798419b
196 changed files with 26627 additions and 421 deletions

View File

@@ -0,0 +1,32 @@
import httpClient from '@/api/httpClient';
import { API_URLS } from '@/api/URLs';
import { AxiosResponse } from 'axios';
import { CreateAdsResponse, PriceCalculationRes } from './types';
export const price_calculation = {
async calculation(params: {
country: string;
region: string;
district: string | 'all';
letters: string | any;
types: string;
}): Promise<AxiosResponse<PriceCalculationRes>> {
const res = await httpClient.get(API_URLS.Price_Calculation, { params });
return res;
},
async ad(body: FormData): Promise<AxiosResponse<CreateAdsResponse>> {
const res = await httpClient.post(API_URLS.Add_Ads, body, {
headers: {
'Content-Type': 'multipart/form-data',
},
});
return res;
},
async payment(body: { return_url: string; adId: number; paymentType: 'payme' | 'referral' }) {
const res = await httpClient.post(API_URLS.Payment_Ads(body.paymentType, body.adId), {
return_url: body.return_url,
});
return res;
},
};

View File

@@ -0,0 +1,21 @@
export interface PriceCalculationRes {
country: string;
region: string;
district: string;
letters: string[];
one_person_price: number;
user_count: number;
total_price: number;
user_ids: number[];
}
export interface CreateAdsResponse {
status: boolean;
data: {
description: string;
id: number;
phone_number: string;
title: string;
total_price: number;
};
}