Hello, i'm trying to access/render the properties of a model called garbageCollectionSchedules that is related to address, and address is related to user.
In this code i'm able to render it on the screen, but i get this error. How do i fix it?
Hello, i
Code:
<Card>
<CardHeader>
<p className="text-2xl font-semibold">{label}</p>
</CardHeader>
<Card className="col-span-4 md:col-span-3">
<CardContent className="space-y-2">
{user?.addresses.map((address, index) => (
<Card className="col-span-4 md:col-span-3">
<div key={index} className="flex flex-row items-center justify-between rounded-lg border p-3 shadow-sm">
<div>
<p>Establishment Name: {address.establishmentName}</p>
<p>Street: {address.street}</p>
<p>Neighborhood: {address.neighborhood}</p>
<p>Number: {address.number}</p>
<p>Other: {JSON.stringify(address.garbageCollectionSchedules)}</p>
</div>
</div>
</Card>
))}
</CardContent>
</Card>
Even though i can see the property on prisma studio i get the following error:
Property 'garbageCollectionSchedules' does not exist on type '{ address_id: string; user_id: string; establishmentName: string; street: string; neighborhood: string; number: string; complement: string; coordinates: JsonValue; createdAt: Date; updatedAt: Date; }'.ts(2339)