mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: reformat utility req functions to use next
This commit is contained in:
parent
1f6020efc0
commit
bb0f9166f9
14 changed files with 43 additions and 41 deletions
|
|
@ -7,19 +7,19 @@ import { RequestBody, errorHandling } from "@services/utils/ts/requests";
|
|||
*/
|
||||
|
||||
export async function createNewOrganization(body: any) {
|
||||
const result = await fetch(`${getAPIUrl()}orgs/`, RequestBody("POST", body));
|
||||
const result = await fetch(`${getAPIUrl()}orgs/`, RequestBody("POST", body, null));
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
}
|
||||
|
||||
export async function deleteOrganizationFromBackend(org_id: any) {
|
||||
const result = await fetch(`${getAPIUrl()}orgs/${org_id}`, RequestBody("DELETE", null));
|
||||
const result = await fetch(`${getAPIUrl()}orgs/${org_id}`, RequestBody("DELETE", null, null));
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
}
|
||||
|
||||
export async function getOrganizationContextInfo(org_slug: any) {
|
||||
const result = await fetch(`${getAPIUrl()}orgs/slug/${org_slug}`, RequestBody("GET", null));
|
||||
export async function getOrganizationContextInfo(org_slug: any, next: any) {
|
||||
const result = await fetch(`${getAPIUrl()}orgs/slug/${org_slug}`, RequestBody("GET", null,next));
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue