mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
chore: refactor courses ts
This commit is contained in:
parent
f4466d1932
commit
ab96e34029
2 changed files with 19 additions and 38 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue