Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeater Component for Nested Objects #41

Open
ubemacapuno opened this issue Jul 16, 2023 · 0 comments
Open

Repeater Component for Nested Objects #41

ubemacapuno opened this issue Jul 16, 2023 · 0 comments
Assignees

Comments

@ubemacapuno
Copy link
Owner

An example of this component will be for restaurants. We need a form that will add an object for restaurant dishes within a restaurant.

If you look at restaurants_fields in the current schema, there is a field for dishes.
Dishes is an array of objects that will have this shape:

restaurant_dishes_fields = {
	name: z.string().min(1, REQUIRED_FIELD),
	rating: z.string().nonempty().default('5'),
	description: z
		.string()
		.max(1000, 'Description must not exceed 1000 characters.')
		.nullable()
		.optional(),
	notes: z.string().max(1000, 'Notes must not exceed 1000 characters.').nullable().optional()
}

We need a repeater that can add dishes objects to the restaurant dishes array. Refer to other SvelteKit projects for examples.

@ubemacapuno ubemacapuno self-assigned this Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant