botpress / modules

MOVING TO BOTPRESS/BOTPRESS, branch `develop/x`, folder "packages"
GNU Affero General Public License v3.0
23 stars 29 forks source link

Broadcasting: Invalid time value @ POST #9

Closed to7be closed 6 years ago

to7be commented 6 years ago

Hello,

when I run the PUT on the API it works like a charm an returns the id:

api.put("botpress-broadcast/broadcasts", {
    date: "2018-04-04",
    time: "12:04:00",
    timezone: null,
    type: "text",
    content: "test put",
    filters: ["bp.users.hasTag(userId, 'TEST')"]
})

But performing a POST results in the error message below this snippet:

api.post("botpress-broadcast/broadcasts", {
    id: "80",
    date: "2018-04-04",
    time: "12:04:00",
    timezone: null,
    type: "text",
    content: "test post",
    filters: ["bp.users.hasTag(userId, 'TEST')"]
})

Error:

RangeError: Invalid time value
    at Date.toISOString (<anonymous>)
    at Object.dateFormat [as format] (webpack-internal:///5:23:52)
    at Object.updateSchedule (/Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/botpress-broadcast/bin/webpack:/src/db.js:70:28)
    at /Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/botpress-broadcast/bin/webpack:/src/index.js:61:10
    at Layer.handle [as handle_request] (/Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/express/lib/router/layer.js:95:5)
    at /Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/express/lib/router/index.js:335:12)
    at next (/Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/express/lib/router/index.js:275:10)
    at Function.handle (/Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/express/lib/router/index.js:174:3)
    at router (/Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/express/lib/router/index.js:47:12)
    at Layer.handle [as handle_request] (/Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/express/lib/router/index.js:317:13)
    at /Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/express/lib/router/index.js:335:12)
    at next (/Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/express/lib/router/index.js:275:10)
    at serveStatic (/Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/serve-static/index.js:75:16)
    at Layer.handle [as handle_request] (/Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/express/lib/router/index.js:317:13)
    at /Users/tobiaswaitschies/Projects/nivea-marlies/node_modules/express/lib/router/index.js:284:7
ERROR:: undefined
Error with posting data broadcast_schedule: Error: Request failed with status code 500

Any ideas? Thanks in advance!