Skip to content

Commit

Permalink
refactor: reorganize schema imports and move definitions to appropria…
Browse files Browse the repository at this point in the history
…te directories
  • Loading branch information
MishraShardendu22 committed Jan 27, 2025
1 parent a1648d4 commit bb74f34
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions src/sanity/schemaTypes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
28 changes: 28 additions & 0 deletions src/sanity/structure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit bb74f34

Please sign in to comment.