Skip to content

Latest commit

 

History

History
50 lines (30 loc) · 1.33 KB

_utils_collection_.md

File metadata and controls

50 lines (30 loc) · 1.33 KB

@directus/sdk-js

Globals / "utils/collection" /

External module: "utils/collection"

Index

Variables

Functions

Variables

Const DIRECTUS_COLLECTION_PREFIX

DIRECTUS_COLLECTION_PREFIX: "directus_" = "directus_"

Defined in utils/collection.ts:5

Functions

getCollectionItemPath

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