#Using static config files with admin panel

1 messages · Page 1 of 1 (latest)

meager canopy
#

I want to to make inventory-item relationship. Inventory stores id of item, admin panel finds item by id and shows full info.

That would be easy using relationship field. But here I want to hardcode item data in config files because items are not supposed to be changed in runtime. So accessing item data is read only operation.

What is best approach for this task?

meager canopy
#

From what I understand I have to create custom server component which will read config file.
But while it is not hard to read data inside this component, is it still possible to make this data accessible from outside? For example, search inventories that have particular item - by its name, not by id

opaque shoal
#

If they don't change you can also just put them in a .TS file?

meager canopy
#

Yes, but it only eliminates one step - file parsing. Which is the easiest part here and poses no threat to main goal

opaque shoal
#

where is the data being read?

#

I slap any static configs that needs selecting into select fields

meager canopy
#

Read in app or in admin panel?

opaque shoal
#

admin and app (last time I did this I got lazy and just duplicated the files instead of setting up a proper monorepo structure)