From bb74f34191f06c031df07387efa420537f930f7c Mon Sep 17 00:00:00 2001 From: Shardendu Mishra Date: Mon, 27 Jan 2025 21:11:46 +0530 Subject: [PATCH] refactor: reorganize schema imports and move definitions to appropriate directories --- src/sanity/schemaTypes/{ => cgc}/cgc.ts | 0 .../schemaTypes/{ => generalInfo}/Finance.ts | 0 src/sanity/schemaTypes/index.ts | 8 +++--- .../building_and_works.ts | 0 .../{ => studentLife}/student_coordinators.ts | 0 src/sanity/structure.ts | 28 +++++++++++++++++++ 6 files changed, 32 insertions(+), 4 deletions(-) rename src/sanity/schemaTypes/{ => cgc}/cgc.ts (100%) rename src/sanity/schemaTypes/{ => generalInfo}/Finance.ts (100%) rename src/sanity/schemaTypes/{ => newsAndUpdates}/building_and_works.ts (100%) rename src/sanity/schemaTypes/{ => studentLife}/student_coordinators.ts (100%) diff --git a/src/sanity/schemaTypes/cgc.ts b/src/sanity/schemaTypes/cgc/cgc.ts similarity index 100% rename from src/sanity/schemaTypes/cgc.ts rename to src/sanity/schemaTypes/cgc/cgc.ts diff --git a/src/sanity/schemaTypes/Finance.ts b/src/sanity/schemaTypes/generalInfo/Finance.ts similarity index 100% rename from src/sanity/schemaTypes/Finance.ts rename to src/sanity/schemaTypes/generalInfo/Finance.ts diff --git a/src/sanity/schemaTypes/index.ts b/src/sanity/schemaTypes/index.ts index bd094e9..22537c3 100644 --- a/src/sanity/schemaTypes/index.ts +++ b/src/sanity/schemaTypes/index.ts @@ -38,10 +38,10 @@ import { ContactData, ContactInf, } from './generalInfo/ContactInfo'; -import { building_and_works } from './building_and_works'; -import { cgc } from './cgc'; -import { Finance } from './Finance'; -import { student_coordinators } from './student_coordinators'; +import { building_and_works } from './newsAndUpdates/building_and_works'; +import { cgc } from './cgc/cgc'; +import { Finance } from './generalInfo/Finance'; +import { student_coordinators } from './studentLife/student_coordinators'; export const schema: { types: SchemaTypeDefinition[] } = { types: [ diff --git a/src/sanity/schemaTypes/building_and_works.ts b/src/sanity/schemaTypes/newsAndUpdates/building_and_works.ts similarity index 100% rename from src/sanity/schemaTypes/building_and_works.ts rename to src/sanity/schemaTypes/newsAndUpdates/building_and_works.ts diff --git a/src/sanity/schemaTypes/student_coordinators.ts b/src/sanity/schemaTypes/studentLife/student_coordinators.ts similarity index 100% rename from src/sanity/schemaTypes/student_coordinators.ts rename to src/sanity/schemaTypes/studentLife/student_coordinators.ts diff --git a/src/sanity/structure.ts b/src/sanity/structure.ts index a55cfbf..2d58624 100644 --- a/src/sanity/structure.ts +++ b/src/sanity/structure.ts @@ -95,6 +95,9 @@ export const structure: StructureResolver = (S) => S.listItem() .title('Jobs') .child(S.documentTypeList('jobs').title('Jobs')), + S.listItem() + .title('Finance') + .child(S.documentTypeList('finance').title('Finance')), ]) ), S.listItem() @@ -135,6 +138,13 @@ export const structure: StructureResolver = (S) => S.listItem() .title('Former') .child(S.documentTypeList('former').title('Former')), + S.listItem() + .title('Building And Works') + .child( + S.documentTypeList('buildingAndWorks').title( + 'Building And Works' + ) + ), ]) ), S.listItem() @@ -200,6 +210,24 @@ export const structure: StructureResolver = (S) => S.listItem() .title('Clubs') .child(S.documentTypeList('club').title('Clubs')), + S.listItem() + .title('Student Coordinators') + .child( + S.documentTypeList('student_coordinators').title( + 'Student Coordinators' + ) + ), + ]) + ), + S.listItem() + .title('CGC') + .child( + S.list() + .title('CGC') + .items([ + S.listItem() + .title('CGC') + .child(S.documentTypeList('cgc').title('CGC')), ]) ), ...S.documentTypeListItems().filter(schemaFilter),