mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: init install mode
This commit is contained in:
parent
687f7b2116
commit
056365dac9
21 changed files with 1230 additions and 6 deletions
32
front/services/install/install.ts
Normal file
32
front/services/install/install.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import { getAPIUrl } from "@services/config/config";
|
||||
import { RequestBody, errorHandling } from "@services/utils/ts/requests";
|
||||
|
||||
export async function updateInstall(body: any, step: number) {
|
||||
const result = await fetch(`${getAPIUrl()}install/update?step=${step}`, RequestBody("POST", body, null));
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
}
|
||||
|
||||
export async function createNewOrgInstall(body: any) {
|
||||
const result = await fetch(`${getAPIUrl()}install/org`, RequestBody("POST", body, null));
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
}
|
||||
|
||||
export async function createNewUserInstall(body: any) {
|
||||
const result = await fetch(`${getAPIUrl()}install/user?org_slug=${body.org_slug}`, RequestBody("POST", body, null));
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
}
|
||||
|
||||
export async function createSampleDataInstall(username: string, org_slug: string) {
|
||||
const result = await fetch(`${getAPIUrl()}install/sample?username=${username}&org_slug=${org_slug}`, RequestBody("POST", null, null));
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
}
|
||||
|
||||
export async function createDefaultElements() {
|
||||
const result = await fetch(`${getAPIUrl()}install/default_elements`, RequestBody("POST", null, null));
|
||||
const res = await errorHandling(result);
|
||||
return res;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue