created post has only h1 title without content.
Step 3 code that I used
import { axios } from “@pipedream/platform”;
export default defineComponent({
props: {
google: {
type: “app”,
app: “google”,
},
},
async run({ steps, $ }) {
const folderId = “1Sd-4LdWthAZrl46-BiMHh59sW5alUG0-”;
const fileListResponse = await axios($, {
method: “GET”,
url: “https://www.googleapis.com/drive/v3/files”,
params: {
q: '${folderId}' in parents
,
orderBy: “createdTime desc”,
pageSize: 1,
},
headers: {
Authorization: Bearer ${**this**.google.$auth.oauth_access_token}
,
},
});
**if** (
fileListResponse.data &&
fileListResponse.data.files &&
fileListResponse.data.files.length > 0
) {
**const** latestFileId = fileListResponse.data.files[0].id;
_// Rest of the code_
} **else** {
console.log("No files found in the specified folder.");
}
},
});
Step 4 code that I used
import { axios } from “@pipedream/platform”;
export default defineComponent({
props: {
wordpress_org: {
type: “app”,
app: “wordpress_org”,
},
title: {
type: “string”,
label: “Post Title”,
},
content: {
type: “string”,
label: “Post Content”,
},
},
async run({ $ }) {
const endpoint = “https://digitaltopical.com/wp-json/wp/v2/posts”;
const auth = Buffer.from(${**this**.wordpress_org.$auth.username}:${**this**.wordpress_org.$auth.application_password}
).toString(“base64”);
**const** response = **await** axios($, {
method: "POST",
url: endpoint,
headers: {
Authorization: `Basic ${auth}`,
},
data: {
title: **this**.title,
content: **this**.content,
},
});
**return** response;
},
});
Step 5 configured
Title
steps.step3.file
Title of the post
Content
steps.step3.content
but has error
Error
Autodiscovery failed