with Predis.ai and Formatting?
Get the duration between two dates in days, hours, minutes, and seconds along with checking if they are the same.
Format a date string to another date string. For more examples on formatting, see the Sugar Date Format documentation.
import { axios } from "@pipedream/platform"
export default defineComponent({
  props: {
    predis_ai: {
      type: "app",
      app: "predis_ai",
    }
  },
  async run({steps, $}) {
    return await axios($, {
      url: `https://brain.predis.ai/predis_api/v1/get_posts/`,
      headers: {
        "authorization": `${this.predis_ai.$auth.api_key}`,
      },
      params: {
        brand_id: `${this.predis_ai.$auth.brand_id}`,
      },
    })
  },
})
export default defineComponent({
  async run({ steps, $ }) {
    const text = ' Hello world! ';
    return text.trim()
  },
})