From ed5304c48c4b326dcc686be0ce70ab388e1bd7c3 Mon Sep 17 00:00:00 2001 From: Wan Qi Chen <495709+wa0x6e@users.noreply.github.com> Date: Mon, 4 Nov 2024 12:35:03 +0900 Subject: [PATCH] fix: move out email subscription creation from profile --- src/schemas/profile.json | 22 +++++-------------- .../profile-addEmailSubscription.json | 8 ------- .../profile-updateEmailSubscription.json | 4 +--- test/schema.spec.ts | 6 ----- 4 files changed, 6 insertions(+), 34 deletions(-) delete mode 100644 test/examples/profile-addEmailSubscription.json diff --git a/src/schemas/profile.json b/src/schemas/profile.json index 64a41b2be..e30c6f15c 100644 --- a/src/schemas/profile.json +++ b/src/schemas/profile.json @@ -52,23 +52,11 @@ "pattern": "^[a-z0-9-]*$", "maxLength": 17 }, - "emailSubscription": { - "type": "object", - "properties": { - "email": { - "type": "string", - "title": "email", - "maxLength": 256 - }, - "subscriptions": { - "type": "array", - "title": "subscriptions", - "uniqueItems": true, - "items": { "type": "string" } - } - }, - "required": [], - "additionalProperties": false + "emailSubscriptions": { + "type": "array", + "title": "email subscriptions", + "uniqueItems": true, + "items": { "type": "string" } } }, "required": [], diff --git a/test/examples/profile-addEmailSubscription.json b/test/examples/profile-addEmailSubscription.json deleted file mode 100644 index c53877b43..000000000 --- a/test/examples/profile-addEmailSubscription.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "Vitalik", - "avatar": "ipfs://NnVTdgcFciJUoxqgsNe9Hy2R7rgvEb5jDu5Pa5mmEG3UghbubTf2M78jUXbKLqKM", - "about": "This is my about info", - "emailSubscription": { - "email": "test@email.com" - } -} diff --git a/test/examples/profile-updateEmailSubscription.json b/test/examples/profile-updateEmailSubscription.json index f08a6beee..b893c4bdd 100644 --- a/test/examples/profile-updateEmailSubscription.json +++ b/test/examples/profile-updateEmailSubscription.json @@ -2,7 +2,5 @@ "name": "Vitalik", "avatar": "ipfs://NnVTdgcFciJUoxqgsNe9Hy2R7rgvEb5jDu5Pa5mmEG3UghbubTf2M78jUXbKLqKM", "about": "This is my about info", - "emailSubscription": { - "subscriptions": ["summary", "newProposal"] - } + "emailSubscriptions": ["summary", "newProposal"] } diff --git a/test/schema.spec.ts b/test/schema.spec.ts index dd78eb4d0..b82d15934 100644 --- a/test/schema.spec.ts +++ b/test/schema.spec.ts @@ -7,7 +7,6 @@ import spaceStarknetDelegation from './examples/space-starknet-delegation.json'; import proposalTurbo from './examples/proposal-turbo.json'; import vote from './examples/vote.json'; import profile from './examples/profile.json'; -import profileAddEmailSubscription from './examples/profile-addEmailSubscription.json'; import profileUpdateEmailSubscription from './examples/profile-updateEmailSubscription.json'; import statement from './examples/statement.json'; import alias from './examples/alias.json'; @@ -26,11 +25,6 @@ describe.each([ { schemaType: 'proposal', schema: schemas.proposal, example: proposal }, { schemaType: 'vote', schema: schemas.vote, example: vote }, { schemaType: 'profile', schema: schemas.profile, example: profile }, - { - schemaType: 'profile', - schema: schemas.profile, - example: profileAddEmailSubscription - }, { schemaType: 'profile', schema: schemas.profile,