mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
feat(legal): wire recurrent-payments document + restore footer link
Backend now serves a dedicated recurring-payments legal document, so: - Add adminLegalPagesApi.get/updateRecurrentPayments and infoApi.getRecurrentPayments (+ InfoVisibility.recurrent). - AdminLegalPages: new 'Рекуррентные платежи' editor tab (DocumentEditor now driven by a DOCUMENT_API dispatch map instead of privacy/offer ternaries). - PublicLegal: add 'recurrent' doc; add public /recurrent-payments route. - Re-add the recurrent link to the login LegalFooter (was removed pending backend). - i18n: admin.legalPages.tabs.recurrent for ru/en/fa/zh (footer.recurrent already existed). type-check, eslint, prettier and build all pass.
This commit is contained in:
@@ -111,6 +111,23 @@ export const adminLegalPagesApi = {
|
||||
return response.data;
|
||||
},
|
||||
|
||||
getRecurrentPayments: async (): Promise<LegalDocumentResponse> => {
|
||||
const response = await apiClient.get<LegalDocumentResponse>(
|
||||
'/cabinet/admin/legal-pages/recurrent-payments',
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
updateRecurrentPayments: async (
|
||||
data: LegalDocumentUpdateRequest,
|
||||
): Promise<LegalDocumentResponse> => {
|
||||
const response = await apiClient.put<LegalDocumentResponse>(
|
||||
'/cabinet/admin/legal-pages/recurrent-payments',
|
||||
data,
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
getRules: async (): Promise<AdminRulesResponse> => {
|
||||
const response = await apiClient.get<AdminRulesResponse>('/cabinet/admin/legal-pages/rules');
|
||||
return response.data;
|
||||
|
||||
@@ -23,6 +23,11 @@ export interface PublicOfferResponse {
|
||||
updated_at: string | null;
|
||||
}
|
||||
|
||||
export interface RecurrentPaymentsResponse {
|
||||
content: string;
|
||||
updated_at: string | null;
|
||||
}
|
||||
|
||||
export interface ServiceInfo {
|
||||
name: string;
|
||||
description: string | null;
|
||||
@@ -42,6 +47,7 @@ export interface InfoVisibility {
|
||||
rules: boolean;
|
||||
privacy: boolean;
|
||||
offer: boolean;
|
||||
recurrent: boolean;
|
||||
}
|
||||
|
||||
export const infoApi = {
|
||||
@@ -75,6 +81,14 @@ export const infoApi = {
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Get recurring-payments document
|
||||
getRecurrentPayments: async (): Promise<RecurrentPaymentsResponse> => {
|
||||
const response = await apiClient.get<RecurrentPaymentsResponse>(
|
||||
'/cabinet/info/recurrent-payments',
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Get service info
|
||||
getServiceInfo: async (): Promise<ServiceInfo> => {
|
||||
const response = await apiClient.get<ServiceInfo>('/cabinet/info/service');
|
||||
|
||||
Reference in New Issue
Block a user