diff --git a/migrations/1776675571_updated_cps.go b/migrations/1776675571_updated_cps.go new file mode 100644 index 0000000..68cb3e7 --- /dev/null +++ b/migrations/1776675571_updated_cps.go @@ -0,0 +1,68 @@ +package migrations + +import ( + "github.com/pocketbase/pocketbase/core" + m "github.com/pocketbase/pocketbase/migrations" +) + +func init() { + m.Register(func(app core.App) error { + collection, err := app.FindCollectionByNameOrId("pbc_1556475754") + if err != nil { + return err + } + + // update field + if err := collection.Fields.AddMarshaledJSONAt(3, []byte(`{ + "hidden": false, + "id": "file3309110367", + "maxSelect": 5, + "maxSize": 0, + "mimeTypes": [ + "image/png", + "image/jpeg", + "image/webp" + ], + "name": "images", + "presentable": false, + "protected": false, + "required": true, + "system": false, + "thumbs": [], + "type": "file" + }`)); err != nil { + return err + } + + return app.Save(collection) + }, func(app core.App) error { + collection, err := app.FindCollectionByNameOrId("pbc_1556475754") + if err != nil { + return err + } + + // update field + if err := collection.Fields.AddMarshaledJSONAt(3, []byte(`{ + "hidden": false, + "id": "file3309110367", + "maxSelect": 3, + "maxSize": 0, + "mimeTypes": [ + "image/png", + "image/jpeg", + "image/webp" + ], + "name": "images", + "presentable": false, + "protected": false, + "required": true, + "system": false, + "thumbs": [], + "type": "file" + }`)); err != nil { + return err + } + + return app.Save(collection) + }) +} diff --git a/website/src/routes/create/+page.svelte b/website/src/routes/create/+page.svelte index 7f5b5a2..e7ee7fc 100644 --- a/website/src/routes/create/+page.svelte +++ b/website/src/routes/create/+page.svelte @@ -25,7 +25,6 @@ !description.trim() || !pictures || pictures.length < 1 || - pictures.length > 3 || !character1.trim() || !character2.trim() ) { @@ -33,6 +32,11 @@ return; } + if (pictures.length > 5) { + errorText = 'You can only upload up to 5 images'; + return; + } + if (character1 === character2) { errorText = 'Character #1 and Character #2 cannot be the same'; return;