ошибка при отправлении POST запроса 422 Typescript/ react
как исправить ошибку 422, которую я получаю после нажатия на кнопку формы? подскажите, пожалуйста)
файл service.ts
import api from "@/api/api";
import { NotificationCloseService } from "./types";
export const sendActionOnNotificationClose: NotificationCloseService = async ({
userRole,
hiddenActions,
}) => {
await api.post(`/${userRole}/action/hide-action/${hiddenActions}`);
};
файл types.ts
export enum UserActionType {
onboarding = 'onboarding_display',
whyLongCalculationsNotification = 'why_long_calculations_notification_display'
}
export interface NotificationCloseService {
(params: {
userRole: 'admin' | 'agent',
hiddenActions: UserActionType
}): Promise<void>;
}
Источник: Stack Overflow на русском