From 69bb334b20ef1f5601cbea74f09a9915910b53c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxi=20Quo=C3=9F?= Date: Sat, 28 Dec 2024 12:49:18 +0100 Subject: [PATCH] fix: make more buttons reactive, remove user create rule, close #800 --- .../migrations/1735385555_updated_users.go | 40 +++++++++++++++++++ frontend/src/lib/components/DeviceCard.svelte | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 backend/migrations/1735385555_updated_users.go diff --git a/backend/migrations/1735385555_updated_users.go b/backend/migrations/1735385555_updated_users.go new file mode 100644 index 00000000..26011067 --- /dev/null +++ b/backend/migrations/1735385555_updated_users.go @@ -0,0 +1,40 @@ +package migrations + +import ( + "encoding/json" + + "github.com/pocketbase/pocketbase/core" + m "github.com/pocketbase/pocketbase/migrations" +) + +func init() { + m.Register(func(app core.App) error { + collection, err := app.FindCollectionByNameOrId("27do0wbcuyfmbmx") + if err != nil { + return err + } + + // update collection data + if err := json.Unmarshal([]byte(`{ + "createRule": "" + }`), &collection); err != nil { + return err + } + + return app.Save(collection) + }, func(app core.App) error { + collection, err := app.FindCollectionByNameOrId("27do0wbcuyfmbmx") + if err != nil { + return err + } + + // update collection data + if err := json.Unmarshal([]byte(`{ + "createRule": "@request.body.password:isset = false" + }`), &collection); err != nil { + return err + } + + return app.Save(collection) + }) +} diff --git a/frontend/src/lib/components/DeviceCard.svelte b/frontend/src/lib/components/DeviceCard.svelte index 672b3569..a93f3aa0 100644 --- a/frontend/src/lib/components/DeviceCard.svelte +++ b/frontend/src/lib/components/DeviceCard.svelte @@ -30,7 +30,7 @@ export let device: Device; - let moreButtons = [ + $: moreButtons = [ { text: $LL.device.card_btn_more_edit(), icon: faPen,