chore: refactor courses ts

This commit is contained in:
swve 2023-02-02 21:45:50 +01:00
parent f4466d1932
commit ab96e34029
2 changed files with 19 additions and 38 deletions

View file

@ -12,8 +12,19 @@ export const RequestBody = (method: string, data: any) => {
return options;
};
export const swrFetcher = async (url: string, body: any) => {
export const RequestBodyForm = (method: string, data: any) => {
let HeadersConfig = new Headers({});
let options: any = {
method: method,
headers: HeadersConfig,
redirect: "follow",
credentials: "include",
body: data,
};
return options;
};
export const swrFetcher = async (url: string, body: any) => {
// Create the request options
let HeadersConfig = new Headers({ "Content-Type": "application/json" });
let options: any = {