mirror of
https://github.com/seriousm4x/UpSnap.git
synced 2026-03-31 06:24:11 -04:00
fix: static page reload fails, use search param device id, close #1711
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
{
|
||||
text: m.device_card_btn_more_edit(),
|
||||
icon: faPen,
|
||||
onClick: () => goto(resolve(`/device/${device.id}`)),
|
||||
onClick: () => goto(resolve(`/device?id=${device.id}`)),
|
||||
requires: $pocketbase.authStore.isSuperuser || $permission.update?.includes(device.id)
|
||||
}
|
||||
]);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
$effect(() => {
|
||||
if (Object.hasOwn($permission, 'update')) {
|
||||
const id = page.params.id;
|
||||
const id = page.url.searchParams.get('id');
|
||||
if (!$pocketbase.authStore.isSuperuser && !$permission.update.includes(id || '')) {
|
||||
toast(m.toasts_no_permission({ url: page.url.pathname }), {
|
||||
icon: '⛔'
|
||||
@@ -22,7 +22,7 @@
|
||||
});
|
||||
|
||||
async function getDevice(): Promise<Device> {
|
||||
const id = page.params.id;
|
||||
const id = page.url.searchParams.get('id');
|
||||
if (!id) throw new Error('No device ID provided');
|
||||
|
||||
const resp = await $pocketbase.collection('devices').getOne(id, { expand: 'ports,groups' });
|
||||
@@ -18,7 +18,7 @@ const config = {
|
||||
'/login',
|
||||
'/account',
|
||||
'/welcome',
|
||||
'/device/[id]',
|
||||
'/device',
|
||||
'/device/new',
|
||||
'/users',
|
||||
'/settings'
|
||||
|
||||
Reference in New Issue
Block a user