fix: align PocketBase type definitions with actual schema
Remove slug field from PageContentRecord (intro/bio collections have none). Remove number field from SectionRecord (not stored in PocketBase); derive zero-padded display number from the order field at render time.
This commit is contained in:
@@ -5,9 +5,9 @@ import { SectionsAccordion } from './SectionsAccordion';
|
||||
const baseRecord = { collectionId: 'c1', collectionName: 'sections', created: '', updated: '' };
|
||||
|
||||
const sections: SectionRecord[] = [
|
||||
{ ...baseRecord, id: '1', slug: 'intro', title: 'Intro', number: '01', order: 1 },
|
||||
{ ...baseRecord, id: '2', slug: 'bio', title: 'Bio', number: '02', order: 2 },
|
||||
{ ...baseRecord, id: '3', slug: 'skills', title: 'Skills', number: '03', order: 3 },
|
||||
{ ...baseRecord, id: '1', slug: 'intro', title: 'Intro', order: 1 },
|
||||
{ ...baseRecord, id: '2', slug: 'bio', title: 'Bio', order: 2 },
|
||||
{ ...baseRecord, id: '3', slug: 'skills', title: 'Skills', order: 3 },
|
||||
];
|
||||
|
||||
describe('SectionsAccordion', () => {
|
||||
|
||||
@@ -33,7 +33,7 @@ export function SectionsAccordion({ sections, activeSlug, children }: Props) {
|
||||
<SectionAccordion
|
||||
key={section.slug}
|
||||
id={section.slug}
|
||||
number={section.number}
|
||||
number={String(section.order).padStart(2, '0')}
|
||||
title={section.title}
|
||||
isActive={activeSlug === section.slug}
|
||||
href={`/${section.slug}`}
|
||||
|
||||
Reference in New Issue
Block a user