From de067673067cc1bad3d5e78bd1495b9ef409704c Mon Sep 17 00:00:00 2001 From: Egor Date: Mon, 26 Jan 2026 22:39:11 +0300 Subject: [PATCH] Add files via upload --- src/api/adminPaymentMethods.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/api/adminPaymentMethods.ts diff --git a/src/api/adminPaymentMethods.ts b/src/api/adminPaymentMethods.ts new file mode 100644 index 0000000..0a866d4 --- /dev/null +++ b/src/api/adminPaymentMethods.ts @@ -0,0 +1,31 @@ +import apiClient from './client' +import type { PaymentMethodConfig, PromoGroupSimple } from '../types' + +export const adminPaymentMethodsApi = { + getAll: async (): Promise => { + const response = await apiClient.get('/cabinet/admin/payment-methods') + return response.data + }, + + getOne: async (methodId: string): Promise => { + const response = await apiClient.get(`/cabinet/admin/payment-methods/${methodId}`) + return response.data + }, + + update: async (methodId: string, data: Record): Promise => { + const response = await apiClient.put( + `/cabinet/admin/payment-methods/${methodId}`, + data + ) + return response.data + }, + + updateOrder: async (methodIds: string[]): Promise => { + await apiClient.put('/cabinet/admin/payment-methods/order', { method_ids: methodIds }) + }, + + getPromoGroups: async (): Promise => { + const response = await apiClient.get('/cabinet/admin/payment-methods/promo-groups') + return response.data + }, +}