mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 16:01:40 +03:00
baf0f4b692
closes https://github.com/TryGhost/Arch/issues/45 - This endpoint is here to keep the convention of being able to fetch the resource by it's slug through a `GET /{resource_name}/slug/:slug`. It has identical output as the `GET /collections/:id` endpoint - The alternative would be having an alias and try fetching by :id and then by slug if the result for id was null, but that would be a completely new pattern we have not used anywhere else yet.
11 lines
329 B
JavaScript
11 lines
329 B
JavaScript
import ApplicationAdapter from 'ghost-admin/adapters/application';
|
|
import SlugUrl from 'ghost-admin/utils/slug-url';
|
|
|
|
export default class Tag extends ApplicationAdapter {
|
|
buildURL(_modelName, _id, _snapshot, _requestType, query) {
|
|
let url = super.buildURL(...arguments);
|
|
|
|
return SlugUrl(url, query);
|
|
}
|
|
}
|