feat: add new org creation page

This commit is contained in:
swve 2022-09-25 10:00:53 +02:00
parent 0c6ec386c2
commit 1b3df392b7
2 changed files with 55 additions and 9 deletions

View file

@ -15,11 +15,25 @@ export async function getUserOrganizations() {
.catch((error) => console.log("error", error));
}
// export async function createNewOrganization(user_id) {}
export async function createNewOrganization(body: any) {
const HeadersConfig = new Headers({ "Content-Type": "application/json" });
const requestOptions: any = {
method: "POST",
headers: HeadersConfig,
redirect: "follow",
credentials: "include",
body: JSON.stringify(body),
};
return fetch(`${getAPIUrl()}orgs/`, requestOptions)
.then((result) => result.json())
.catch((error) => console.log("error", error));
}
// export async function getOrganizationData(org_id) {}
export async function deleteOrganizationFromBackend(org_id:any) {
export async function deleteOrganizationFromBackend(org_id: any) {
const HeadersConfig = new Headers({ "Content-Type": "application/json" });
const requestOptions: any = {