You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone, I'm stuck with my project of accomodation booking. My client need to be able to choose a price for each week and for each location. I've done my schemas like this :
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi everyone, I'm stuck with my project of accomodation booking. My client need to be able to choose a price for each week and for each location. I've done my schemas like this :
Product:
export default {
name: 'product',
type: 'document',
title: 'Location',
fields: [
{
name: 'name',
type: 'string',
title: 'Nom Location'
},
{
name: 'images',
type: 'array',
title: 'Image Location',
of: [{type: 'image'}],
},
{
name: 'description',
type: 'text',
title: 'Description Location',
},
{
name: 'slug',
type: 'slug',
title: 'Slug',
options: {
source: 'name'
}
},
{
name: 'price',
type: 'number',
title: 'A partir de',
},
{
name: 'category',
title: 'Station',
type: 'reference',
to: [
{
type: 'category',
},
],
},
{
name: 'disponibilites',
title: 'Disponibilitées',
type: 'array',
of:[{type: 'disponibilites'}]
},
]
}
disponibilites:
export default {
name: 'disponibilites',
title: 'Disponibilités',
type: 'object',
fields: [
{
name: 'semaine',
title:'Semaine',
type: 'reference',
to:[{type: 'semaine'}]
},
{
name: 'prix',
title:'Prix',
type: 'number'
},
]
}
semaine:
export default {
name: 'semaine',
type: 'document',
title: 'Semaines',
fields: [
{
name: 'nom',
title:'Semaine',
type: 'string'
},
{
name: 'debutSemaine',
title:'Du',
type: 'datetime'
},
{
name: 'finSemaine',
title:'Au',
type: 'datetime'
},
]
}
I can create weeks and add a different prices for each weeks and each logement, there is no problems at this point.
My issue is that I can't find the right way to map all of these weeks with each prices on my next Js app...
I've done this query :
Can I have some help?
Regards
Beta Was this translation helpful? Give feedback.
All reactions