Globals / "utils/collection" /
• DIRECTUS_COLLECTION_PREFIX: "directus_" = "directus_"
Defined in utils/collection.ts:5
▸ getCollectionItemPath(collection
: string): string
Defined in utils/collection.ts:22
Returns the correct API path for the collection. It will strip the prefix {@link DIRECTUS_COLLECTION_PREFIX | collection-prefix} or will add the '/items/' path as prefix if not provided. The 'substr(9)' defines the length of the defined {@link DIRECTUS_COLLECTION_PREFIX | collection-prefix}.
example
getCollectionItemPath('directus_users');
// => '/users'
getCollectionItemPath('users');
// => '/items/users'
Parameters:
Name | Type | Description |
---|---|---|
collection |
string | The name of the collection |
Returns: string