Skip to content

Commit 7123a3a

Browse files
committed
fix: optimized image type
1 parent 3134703 commit 7123a3a

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/data/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ export type YearlyEvent = {
6060
for_all: boolean;
6161
future?: string;
6262
//TODO: this should probably also be an ImageWithAlt
63-
image: {
63+
image: GetImageResult & {
6464
alt: string;
65-
src: GetImageResult;
6665
};
6766
month: string;
6867
short_description: string;

src/data/real/events.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export async function getAllYearlyEvents(): Promise<YearlyEvent[]> {
114114
for_all: true,
115115
image: {
116116
alt: 'Eine Gruppe Menschen sitzt in einer Reihe.',
117-
src: await getYearlyEventImage(EventImage1),
117+
...(await getYearlyEventImage(EventImage1)),
118118
},
119119
month: 'September',
120120
short_description:
@@ -127,7 +127,7 @@ export async function getAllYearlyEvents(): Promise<YearlyEvent[]> {
127127
for_all: true,
128128
image: {
129129
alt: 'Menschen sitzen an einem Holztisch und spielen ein Kartenspiel im Garten.',
130-
src: await getYearlyEventImage(EventImage2),
130+
...(await getYearlyEventImage(EventImage2)),
131131
},
132132
month: 'Dezember',
133133
short_description:
@@ -140,7 +140,7 @@ export async function getAllYearlyEvents(): Promise<YearlyEvent[]> {
140140
for_all: false,
141141
image: {
142142
alt: 'Ein großer Kuschelhaufen liegt vor einer Frau die Ukulele spielt.',
143-
src: await getYearlyEventImage(EventImage3),
143+
...(await getYearlyEventImage(EventImage3)),
144144
},
145145
month: 'April',
146146
short_description:

src/data/test/events.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export async function getAllYearlyEvents(): Promise<YearlyEvent[]> {
9393
{
9494
day: '1',
9595
for_all: true,
96-
image: { alt: 'Test Event Image 1', src: await getImage({ src: EventImage1 }) },
96+
image: { alt: 'Test Event Image 1', ...(await getImage({ src: EventImage1 })) },
9797
month: 'Januar',
9898
short_description: 'Das ist ein Test Event. Komm nicht vorbei, weil es ist nicht real.',
9999
slug: 'event-1',
@@ -102,7 +102,7 @@ export async function getAllYearlyEvents(): Promise<YearlyEvent[]> {
102102
{
103103
day: '31',
104104
for_all: true,
105-
image: { alt: 'Test Event Image 2', src: await getImage({ src: EventImage2 }) },
105+
image: { alt: 'Test Event Image 2', ...(await getImage({ src: EventImage2 })) },
106106
month: 'Oktober',
107107
short_description:
108108
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pretium, felis sed luctus tempor',
@@ -112,7 +112,7 @@ export async function getAllYearlyEvents(): Promise<YearlyEvent[]> {
112112
{
113113
day: '24',
114114
for_all: false,
115-
image: { alt: 'Test Event Image 3', src: await getImage({ src: EventImage3 }) },
115+
image: { alt: 'Test Event Image 3', ...(await getImage({ src: EventImage3 })) },
116116
month: 'Mai',
117117
short_description: 'Noch ein Test Event, aber nur für Mitglieder !!!1!!11!111elf1',
118118
slug: 'event-3',

0 commit comments

Comments
 (0)