Ghost/ghost/admin/app/utils/slug-url.js
Gabriel Csapo fdc24103cc [chore] runs native classes codemod for app/adapters (#2239)
no issue

* ran native classes codemod for app/adapters
* migrated slug-url mixin to a utility
2022-02-02 16:57:22 +00:00

11 lines
216 B
JavaScript

import {isBlank} from '@ember/utils';
export default function SlugUrl(url, query) {
if (query && !isBlank(query.slug)) {
url += `slug/${query.slug}/`;
delete query.slug;
}
return url;
}