mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
refactor: migrate to eslint flat config and format codebase with prettier
- Remove legacy .eslintrc.cjs and .eslintignore - Add eslint.config.js with flat config, security rules (no-eval, no-implied-eval, no-new-func, no-script-url) - Add .prettierrc and .prettierignore - Format entire codebase with prettier
This commit is contained in:
@@ -1,31 +1,35 @@
|
||||
import apiClient from './client'
|
||||
import type { PaymentMethodConfig, PromoGroupSimple } from '../types'
|
||||
import apiClient from './client';
|
||||
import type { PaymentMethodConfig, PromoGroupSimple } from '../types';
|
||||
|
||||
export const adminPaymentMethodsApi = {
|
||||
getAll: async (): Promise<PaymentMethodConfig[]> => {
|
||||
const response = await apiClient.get<PaymentMethodConfig[]>('/cabinet/admin/payment-methods')
|
||||
return response.data
|
||||
const response = await apiClient.get<PaymentMethodConfig[]>('/cabinet/admin/payment-methods');
|
||||
return response.data;
|
||||
},
|
||||
|
||||
getOne: async (methodId: string): Promise<PaymentMethodConfig> => {
|
||||
const response = await apiClient.get<PaymentMethodConfig>(`/cabinet/admin/payment-methods/${methodId}`)
|
||||
return response.data
|
||||
const response = await apiClient.get<PaymentMethodConfig>(
|
||||
`/cabinet/admin/payment-methods/${methodId}`,
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
update: async (methodId: string, data: Record<string, unknown>): Promise<PaymentMethodConfig> => {
|
||||
const response = await apiClient.put<PaymentMethodConfig>(
|
||||
`/cabinet/admin/payment-methods/${methodId}`,
|
||||
data
|
||||
)
|
||||
return response.data
|
||||
data,
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
updateOrder: async (methodIds: string[]): Promise<void> => {
|
||||
await apiClient.put('/cabinet/admin/payment-methods/order', { method_ids: methodIds })
|
||||
await apiClient.put('/cabinet/admin/payment-methods/order', { method_ids: methodIds });
|
||||
},
|
||||
|
||||
getPromoGroups: async (): Promise<PromoGroupSimple[]> => {
|
||||
const response = await apiClient.get<PromoGroupSimple[]>('/cabinet/admin/payment-methods/promo-groups')
|
||||
return response.data
|
||||
const response = await apiClient.get<PromoGroupSimple[]>(
|
||||
'/cabinet/admin/payment-methods/promo-groups',
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user