update restart checkbox
This commit is contained in:
@@ -27,7 +27,7 @@ async function fetchAPI(endpoint: string, method: string = 'GET', body?: object,
|
|||||||
});
|
});
|
||||||
redirect(303, '/login');
|
redirect(303, '/login');
|
||||||
}
|
}
|
||||||
throw new Error(`API Error: ${response.statusText}`);
|
throw new Error(`API Error: ${response.statusText} - ${method} - ${endpoint}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.headers.get('Content-Type') == 'application/json') return response.json();
|
if (response.headers.get('Content-Type') == 'application/json') return response.json();
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ export const updateConfig = async (
|
|||||||
serverId: string,
|
serverId: string,
|
||||||
file: ConfigFile,
|
file: ConfigFile,
|
||||||
newConfig?: Config,
|
newConfig?: Config,
|
||||||
override = false,
|
override: boolean | string = false,
|
||||||
restart = true
|
restart: boolean | string = true
|
||||||
) => {
|
) => {
|
||||||
return fetchAPIEvent(
|
return fetchAPIEvent(
|
||||||
event,
|
event,
|
||||||
|
|||||||
@@ -43,10 +43,10 @@ export const actions = {
|
|||||||
|
|
||||||
async function destructureFormData(
|
async function destructureFormData(
|
||||||
event: RequestEvent
|
event: RequestEvent
|
||||||
): Promise<{ id: string; restart: boolean; data: Config; file: configFile }> {
|
): Promise<{ id: string; restart: string; data: Config; file: configFile }> {
|
||||||
const formData = await event.request.formData();
|
const formData = await event.request.formData();
|
||||||
const id = formData.get('id') as string;
|
const id = formData.get('id') as string;
|
||||||
const restart = formData.get('restart') === 'true';
|
const restart = formData.get('restart') as string;
|
||||||
const file = formData.get('file') as configFile;
|
const file = formData.get('file') as configFile;
|
||||||
const object: any = {};
|
const object: any = {};
|
||||||
formData.forEach((value, key) => {
|
formData.forEach((value, key) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user