diff --git a/carbon-projects/schemas/accreditation.ts b/carbon-projects/schemas/accreditation.ts deleted file mode 100644 index 3f0cf08180..0000000000 --- a/carbon-projects/schemas/accreditation.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { defineType } from "sanity"; - -export default defineType({ - name: "accreditation", - title: "Accreditation", - description: "Information about an accreditation that applies to assessors", - type: "document", - preview: { - select: { - name: "name", - }, - prepare(selection) { - return { - title: selection.name || "", - }; - }, - }, - fields: [ - { - type: "string", - title: "Name", - name: "name", - validation: (r) => r.required(), - }, - { - type: "string", - title: "Link", - name: "link", - }, - { - type: "image", - title: "Logo", - name: "logo", - }, - ], -}); diff --git a/carbon-projects/schemas/assessor.ts b/carbon-projects/schemas/assessor.ts index b29d897419..da1b28a8a1 100644 --- a/carbon-projects/schemas/assessor.ts +++ b/carbon-projects/schemas/assessor.ts @@ -36,12 +36,7 @@ export default defineType({ type: "array", title: "Accreditations", name: "accreditations", - of: [ - { - type: "reference", - to: [{ type: "accreditation" }], - }, - ], + of: [{ type: "accreditation" }], }, ], }); diff --git a/carbon-projects/schemas/index.ts b/carbon-projects/schemas/index.ts index 3258e00efc..4e7df975da 100644 --- a/carbon-projects/schemas/index.ts +++ b/carbon-projects/schemas/index.ts @@ -1,9 +1,9 @@ -import accreditation from "./accreditation"; import assessor from "./assessor"; import country from "./country"; import developer from "./developer"; import indexContent from "./indexContent"; import methodology from "./methodology"; +import accreditation from "./objects/accreditation"; import captionImage from "./objects/captionImage"; import externalFile from "./objects/externalFile"; import hostedFile from "./objects/hostedFile"; diff --git a/carbon-projects/schemas/objects/accreditation.ts b/carbon-projects/schemas/objects/accreditation.ts new file mode 100644 index 0000000000..71502d274e --- /dev/null +++ b/carbon-projects/schemas/objects/accreditation.ts @@ -0,0 +1,10 @@ +import { defineType } from "sanity"; + +export default defineType({ + name: "accreditation", + type: "object", + fields: [ + { type: "string", name: "name" }, + { type: "string", name: "link" }, + ], +});