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,39 +1,46 @@
|
||||
import apiClient from './client'
|
||||
import type { PaginatedResponse, PendingPayment, ManualCheckResponse } from '../types'
|
||||
import apiClient from './client';
|
||||
import type { PaginatedResponse, PendingPayment, ManualCheckResponse } from '../types';
|
||||
|
||||
export interface PaymentsStats {
|
||||
total_pending: number
|
||||
by_method: Record<string, number>
|
||||
total_pending: number;
|
||||
by_method: Record<string, number>;
|
||||
}
|
||||
|
||||
export const adminPaymentsApi = {
|
||||
// Get all pending payments (admin)
|
||||
getPendingPayments: async (params?: {
|
||||
page?: number
|
||||
per_page?: number
|
||||
method_filter?: string
|
||||
page?: number;
|
||||
per_page?: number;
|
||||
method_filter?: string;
|
||||
}): Promise<PaginatedResponse<PendingPayment>> => {
|
||||
const response = await apiClient.get<PaginatedResponse<PendingPayment>>('/cabinet/admin/payments', {
|
||||
params,
|
||||
})
|
||||
return response.data
|
||||
const response = await apiClient.get<PaginatedResponse<PendingPayment>>(
|
||||
'/cabinet/admin/payments',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Get payments statistics
|
||||
getStats: async (): Promise<PaymentsStats> => {
|
||||
const response = await apiClient.get<PaymentsStats>('/cabinet/admin/payments/stats')
|
||||
return response.data
|
||||
const response = await apiClient.get<PaymentsStats>('/cabinet/admin/payments/stats');
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Get specific payment details
|
||||
getPayment: async (method: string, paymentId: number): Promise<PendingPayment> => {
|
||||
const response = await apiClient.get<PendingPayment>(`/cabinet/admin/payments/${method}/${paymentId}`)
|
||||
return response.data
|
||||
const response = await apiClient.get<PendingPayment>(
|
||||
`/cabinet/admin/payments/${method}/${paymentId}`,
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Manually check payment status
|
||||
checkPaymentStatus: async (method: string, paymentId: number): Promise<ManualCheckResponse> => {
|
||||
const response = await apiClient.post<ManualCheckResponse>(`/cabinet/admin/payments/${method}/${paymentId}/check`)
|
||||
return response.data
|
||||
const response = await apiClient.post<ManualCheckResponse>(
|
||||
`/cabinet/admin/payments/${method}/${paymentId}/check`,
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user