Add redirect url
This commit is contained in:
@@ -4,6 +4,20 @@ import bodyParser from "body-parser"
|
||||
export default (container) => {
|
||||
const app = Router()
|
||||
|
||||
app.post("/brightpearl/product", bodyParser.json(), async (req, res) => {
|
||||
const { id, lifecycle_event } = req.body
|
||||
|
||||
if (lifecycle_event === "created") {
|
||||
const eventBus = req.scope.resolve("eventBusService")
|
||||
const brightpearlService = req.scope.resolve("brightpearlService")
|
||||
const bpProduct = await brightpearlService.retrieveProduct(id)
|
||||
|
||||
eventBus.emit("brightpearl-product.created", bpProduct)
|
||||
}
|
||||
|
||||
res.sendStatus(200)
|
||||
})
|
||||
|
||||
app.post("/brightpearl/goods-out", bodyParser.json(), async (req, res) => {
|
||||
const { id, lifecycle_event } = req.body
|
||||
const brightpearlService = req.scope.resolve("brightpearlService")
|
||||
|
||||
Reference in New Issue
Block a user