From 394f5654c6a694ea1c5e45ebd6b0925fae9c95c9 Mon Sep 17 00:00:00 2001 From: ditatompel Date: Wed, 8 May 2024 20:07:51 +0700 Subject: [PATCH] Use app.d.ts for jsdoc --- frontend/src/app.d.ts | 6 ++++++ frontend/src/routes/(front)/add-node/+page.svelte | 12 ++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/frontend/src/app.d.ts b/frontend/src/app.d.ts index fe8b593..b2c6e13 100644 --- a/frontend/src/app.d.ts +++ b/frontend/src/app.d.ts @@ -22,6 +22,12 @@ declare global { is_available: boolean; nettype: string; } + + interface ApiResponse { + status: string; + message: string; + data: null | object | object[]; + } } export {}; diff --git a/frontend/src/routes/(front)/add-node/+page.svelte b/frontend/src/routes/(front)/add-node/+page.svelte index ff41a13..d4188ea 100644 --- a/frontend/src/routes/(front)/add-node/+page.svelte +++ b/frontend/src/routes/(front)/add-node/+page.svelte @@ -2,17 +2,10 @@ import { invalidateAll, goto } from '$app/navigation'; import { apiUri } from '$lib/utils/common'; import { ProgressBar } from '@skeletonlabs/skeleton'; + /** @type {import('./$types').PageData} */ export let data; - - /** - * @typedef formResult - * @type {object} - * @property {string} status - * @property {string} message - * @property {null | object} data - */ - /** @type {formResult} */ + /** @type {ApiResponse} */ export let formResult; let isProcessing = false; @@ -31,7 +24,6 @@ isProcessing = false; if (formResult.status === 'ok') { - // rerun all `load` functions, following the successful update await invalidateAll(); goto('/remote-nodes'); }