mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-24 12:49:19 +00:00
* Gulpify build pipeline * Update build frontend script * Fixes * Limit service worker to latest build * Use shorthand * Fix hassio build
28 lines
596 B
TypeScript
28 lines
596 B
TypeScript
import { handleFetchPromise } from "../util/hass-call-api";
|
|
|
|
export interface OnboardingStep {
|
|
step: string;
|
|
done: boolean;
|
|
}
|
|
|
|
interface UserStepResponse {
|
|
auth_code: string;
|
|
}
|
|
|
|
export const fetchOnboardingOverview = () =>
|
|
fetch("/api/onboarding", { credentials: "same-origin" });
|
|
|
|
export const onboardUserStep = (params: {
|
|
client_id: string;
|
|
name: string;
|
|
username: string;
|
|
password: string;
|
|
}) =>
|
|
handleFetchPromise<UserStepResponse>(
|
|
fetch("/api/onboarding/users", {
|
|
method: "POST",
|
|
credentials: "same-origin",
|
|
body: JSON.stringify(params),
|
|
})
|
|
);
|