general table history
Thanks. I might dive into that tomorrow when I return to this.
The other problem is that I'm trying to make the components for this history display as generic as possible. I'm going to have dozens of tables once this is all done, so I'm hoping to find/create a way to allow for easily delving into linked documents without too much custom setup for each table.
5 Replies
you can do this too with the schema parsing if you want
like if you're trying to display a string in table
tableName
and at field path fieldPath
(which is an array of strings) you can do
Thank you! This works perfectly even though the type checker indicates an error with
schema.tables[tableName]
:
I can add a @ts-ignore
comment above that line for now, but I'm curious if there's another way to satisfy the type checker for that line.Making it typecheck sounds like more trouble than it's worth
Yeah, that's kinda what I figured.
As a side question, will that logic with the field path also work if the ID is in an array, or inside an object that's part of an array? Do I need to adjust how I'm building the path array to account for cases like that?
For example, I'm running all of these early tests on my
contacts
table. One of the fields in that table is:
Arrays would require more steps. I recommend exploring your schema -- just start typing the
schema.tables.contacts.validator.fields.
and see what autocomplete gives you