mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
commit
7e95b4d291
3 changed files with 3 additions and 3 deletions
|
@ -76,7 +76,7 @@
|
||||||
// and then update the placeholder value.
|
// and then update the placeholder value.
|
||||||
if (title) {
|
if (title) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: Ghost.paths.apiRoot + '/posts/getSlug/' + encodeURIComponent(title) + '/',
|
url: Ghost.paths.apiRoot + '/posts/slug/' + encodeURIComponent(title) + '/',
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
$postSettingSlugEl.attr('placeholder', result);
|
$postSettingSlugEl.attr('placeholder', result);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ posts = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getSlug: function getSlug(args) {
|
generateSlug: function getSlug(args) {
|
||||||
return dataProvider.Base.Model.generateSlug(dataProvider.Post, args.title, {status: 'all'}).then(function (slug) {
|
return dataProvider.Base.Model.generateSlug(dataProvider.Post, args.title, {status: 'all'}).then(function (slug) {
|
||||||
if (slug) {
|
if (slug) {
|
||||||
return slug;
|
return slug;
|
||||||
|
|
|
@ -9,7 +9,7 @@ module.exports = function (server) {
|
||||||
server.get('/ghost/api/v0.1/posts/:id', api.requestHandler(api.posts.read));
|
server.get('/ghost/api/v0.1/posts/:id', api.requestHandler(api.posts.read));
|
||||||
server.put('/ghost/api/v0.1/posts/:id', api.requestHandler(api.posts.edit));
|
server.put('/ghost/api/v0.1/posts/:id', api.requestHandler(api.posts.edit));
|
||||||
server.del('/ghost/api/v0.1/posts/:id', api.requestHandler(api.posts.destroy));
|
server.del('/ghost/api/v0.1/posts/:id', api.requestHandler(api.posts.destroy));
|
||||||
server.get('/ghost/api/v0.1/posts/getSlug/:title', middleware.authAPI, api.requestHandler(api.posts.getSlug));
|
server.get('/ghost/api/v0.1/posts/slug/:title', middleware.authAPI, api.requestHandler(api.posts.generateSlug));
|
||||||
// #### Settings
|
// #### Settings
|
||||||
server.get('/ghost/api/v0.1/settings/', api.requestHandler(api.settings.browse));
|
server.get('/ghost/api/v0.1/settings/', api.requestHandler(api.settings.browse));
|
||||||
server.get('/ghost/api/v0.1/settings/:key/', api.requestHandler(api.settings.read));
|
server.get('/ghost/api/v0.1/settings/:key/', api.requestHandler(api.settings.read));
|
||||||
|
|
Loading…
Reference in a new issue