getUniqueSlug

Function

Given a slug, search for items using that slug, incrementing the slug name until a unique value is found

For example, if a slug of "snow-map" into this function and some item exists with that slug, it would return "snow-map-1".

  • getUniqueSlug(slugInfo: {
    existingId:
    string
    slug:
    string
    }, requestOptions: IRequestOptions, step: number) : Promise<string>

Parameters

Parameter Type Default Notes
slugInfo Required {
existingId:
string
slug:
string
}
requestOptions Required IRequestOptions
step Optional number 0

Available requestOptions

Property Type Notes

Returns

Promise<string>

Function defined in common/src/items/slugs.ts:140