How do I convert a database ID to a friendly ID?
Objective: This article explains how to convert a database ID (e.g users/123-A
) to a friendly ID (e.g 123-A
).
Example:
import { BaseModel } from '@hectare/platform.components.common'
const userId = 'users/123-A'
const friendlyId = BaseModel.friendlyId(userId)
Related Articles: