Comments added and commented code removed

This commit is contained in:
Porras-Bernardez 2024-05-08 17:11:55 +02:00
commit 85ab6fb8cc
9 changed files with 40 additions and 401 deletions

View file

@ -1,31 +1,16 @@
import { AxiosRequestConfig } from "axios";
import { stringify } from "qs";
// let headers: AxiosRequestConfig['headers'] =
// headers['Content-Type'] = 'multipart/form-data';
/* This file configures Axios to send requests with the specified headers and parameters serialization format for URL-encoded form data */
export const axiosRequestConfiguration: AxiosRequestConfig = {
// responseType: "text",
// headers: {
// // "Content-Type": "text/plain",
// "Content-Type": "application/x-www-form-urlencoded",
// // "Content-Type": "application/x-www-form-urlencoded",
// // credentials: "same-origin",
// // "Access-Control-Allow-Credentials": "true",
// // "Access-Control-Allow-Origin": "*",
// },
headers: {
//: AxiosHeaders | Partial<RawAxiosHeaders & MethodsHeaders & CommonHeaders> | undefined
"Content-Type": "application/x-www-form-urlencoded",
},
// headers: {
// "Content-type": "application/json; charset=UTF-8",
// },
// paramsSerializer: {
// indexes: null, // by default: false
// },
paramsSerializer: {
/* The serialize function takes an object of key-value pairs as input and uses the qs.stringify method to convert it into a URL-encoded string.
The arrayFormat: "repeat" option specifies how arrays should be serialized in the URL parameters. */
serialize: (params: Record<string, number>) => {
return stringify(params, { arrayFormat: "repeat" });
},