I’m seeking some assistance with an issue I’m encountering while working with collections via a plugin. Here’s the problem:
- I’m trying to create a collection using
defineCollection
in my plugin. - When I attempt to list the collections via the
/api/collections:list
endpoint, I’m only able to fetch collections that were created via the UI. - Collections created via
defineCollection
are not appearing in the list API response.
Here’s a snippet of my collection definition:
import { defineCollection } from '@nocobase/database';
export default defineCollection({
name: 'organization',
fields: [{
type: 'string',
name: 'name'
}, {
type: "text",
name: "address"
}]
});
My question is: Do I need to add anything else in the options or configuration to ensure that collections created via defineCollection
are included in the /api/collections:list
response?
Any guidance or suggestions would be greatly appreciated!
Thanks in advance!