Open ulfgebhardt opened 5 years ago
{ error: "Cannot create post. Error: Gateway Time-out", succeeded: false }
import { User, connect } from 'human-connection-api-nodejs-client'; import mongoose from 'mongoose'; import slugify from 'slugify'; import CONSTANTS from '../../../config/constants'; import { getImage } from './subjectGroupToIcon'; async function contributeProcedure({ procedureId, email, password }) { connect(CONSTANTS.HC_BACKEND_URL); const ProcedureModel = mongoose.model('Procedure'); if (procedureId && email && password) { const procedure = await ProcedureModel.findOne({ procedureId }); if (procedure) { const user = new User({ email, password }); return user.contribute( { title: procedure.title, content: procedure.abstract, contentExcerpt: procedure.abstract, type: 'post', language: 'de', teaserImg: `https://www.democracy-app.de/static/images/sachgebiete/${getImage( procedure.subjectGroups[0], )}_1920.jpg`, }, { slug: slugify(procedure.title, { lower: true }), resolveSlugs: { categories: ['democracy-politics'], // organization: CONSTANTS.HC_ORGANIZATION_SLUG, }, }, ); } throw Error('No procedure found.'); } else { throw Error('Please provide procedureId, email and password.'); } }
See: https://github.com/demokratie-live/democracy-server/blob/hc_webhook/src/express/webhooks/socialmedia/humanconnection.js
This error occurs when the URL to the teaserImage is invalid ?!
The request of the Image returned the Error - a more accurate Error message would be appricated
See: https://github.com/demokratie-live/democracy-server/blob/hc_webhook/src/express/webhooks/socialmedia/humanconnection.js
This error occurs when the URL to the teaserImage is invalid ?!