Corrected 2 times post with Blogger provider

This commit is contained in:
benweet 2013-04-21 15:59:29 +01:00
parent 2ed97112da
commit eede86ccc5
2 changed files with 15 additions and 9 deletions

View File

@ -7,17 +7,22 @@ define(["jquery", "core", "google-helper"], function($, core, googleHelper) {
};
bloggerProvider.publish = function(publishAttributes, title, content, callback) {
googleHelper.uploadBlogger(publishAttributes.blogUrl,
publishAttributes.blogId, publishAttributes.postId, title, content,
googleHelper.uploadBlogger(
publishAttributes.blogUrl,
publishAttributes.blogId,
publishAttributes.postId,
title,
content,
function(error, blogId, postId) {
if(error) {
callback(error);
return;
if(error) {
callback(error);
return;
}
publishAttributes.blogId = blogId;
publishAttributes.postId = postId;
callback();
}
publishAttributes.blogId = blogId;
publishAttributes.postId = postId;
callback();
});
);
};
bloggerProvider.newPublishAttributes = function(event) {

View File

@ -464,6 +464,7 @@ define(["jquery", "core", "async-runner"], function($, core, asyncRunner) {
function getBlogId() {
if(blogId !== undefined) {
task.chain(publish);
return;
}
$.ajax({
url : "https://www.googleapis.com/blogger/v3/blogs/byurl",