-
Notifications
You must be signed in to change notification settings - Fork 123
Closed
Description
I wanted to do a simple key value to handle common error strings inside my forms:

keystatic.config.js
formCommon: collection({
label: 'Form Common Texts',
path: 'src/modules/keystatic/content/form-common/*/',
slugField: 'key',
schema: {
key: fields.text({
label: 'Key',
validation: { length: { min: 1 } },
}),
value: fields.text({
label: 'Value',
validation: { length: { min: 1 } },
}),
},
}),When log the content of my data, I have :

I updated my package.json to:
"@keystatic/core": "^0.0.98",
"@keystatic/next": "^0.0.7",
Now, I have to do this:
const col = await reader.collections[resource].read(slug)
if (col && 'key' in col && col?.key === null) {
col.key = slug
}
return colIt's easy to remap it because I just asked .read(slug) .
Expected Behavior
I want to have the slug by default when I ask for a key + value object so I don't have to set the key (slug) by myself.
Current Behavior
Slug is null.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels