mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: admin buttons issue
This commit is contained in:
parent
466616578a
commit
99890a950b
6 changed files with 18 additions and 14 deletions
|
|
@ -9,20 +9,22 @@ function GetStarted() {
|
|||
const { data: install, error: error, isLoading } = useSWR(`${getAPIUrl()}install/latest`, swrFetcher);
|
||||
const router = useRouter()
|
||||
|
||||
function startInstallation() {
|
||||
fetch(`${getAPIUrl()}install/start`, {
|
||||
async function startInstallation() {
|
||||
let res = await fetch(`${getAPIUrl()}install/start`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({})
|
||||
}).then(res => res.json()).then(res => {
|
||||
if (res.success) {
|
||||
mutate(`${getAPIUrl()}install/latest`)
|
||||
router.push(`/install?step=1`)
|
||||
}
|
||||
})
|
||||
|
||||
if (res.status == 200) {
|
||||
mutate(`${getAPIUrl()}install/latest`)
|
||||
router.refresh();
|
||||
router.push(`/install?step=1`)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function redirectToStep() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue