Merge remote-tracking branch 'origin/master-AIO' into feature/IO-3096-GlobalNotifications
This commit is contained in:
@@ -99,6 +99,7 @@ async function OpenSearchUpdateHandler(req, res) {
|
|||||||
break;
|
break;
|
||||||
case "payments":
|
case "payments":
|
||||||
//Query to get the job and RO number
|
//Query to get the job and RO number
|
||||||
|
|
||||||
const payment = await client.request(
|
const payment = await client.request(
|
||||||
`query ADMIN_GET_PAYMENT_BY_ID($paymentId: uuid!) {
|
`query ADMIN_GET_PAYMENT_BY_ID($paymentId: uuid!) {
|
||||||
payments_by_pk(id: $paymentId) {
|
payments_by_pk(id: $paymentId) {
|
||||||
@@ -147,11 +148,25 @@ async function OpenSearchUpdateHandler(req, res) {
|
|||||||
body: document
|
body: document
|
||||||
};
|
};
|
||||||
|
|
||||||
|
logger.log("os-handler", "DEBUG", null, null, {
|
||||||
|
id: req.body.event.data.new.id,
|
||||||
|
index: req.body.table.name,
|
||||||
|
bodyshopid: payload.body.bodyshopid
|
||||||
|
// body: document
|
||||||
|
});
|
||||||
|
|
||||||
const response = await osClient.index(payload);
|
const response = await osClient.index(payload);
|
||||||
//console.log(response.body);
|
//console.log(response.body);
|
||||||
res.status(200).json(response.body);
|
res.status(200).json(response.body);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
logger.log("os-handler-error", "ERROR", null, null, {
|
||||||
|
id: req.body.event.data.new.id,
|
||||||
|
index: req.body.table.name,
|
||||||
|
message: error.message,
|
||||||
|
stack: error.stack
|
||||||
|
// body: document
|
||||||
|
});
|
||||||
res.status(400).json(JSON.stringify(error));
|
res.status(400).json(JSON.stringify(error));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -166,7 +181,9 @@ async function OpenSearchSearchHandler(req, res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
logger.log("os-search", "DEBUG", req.user.email, null, {
|
logger.log("os-search", "DEBUG", req.user.email, null, {
|
||||||
search
|
search,
|
||||||
|
index,
|
||||||
|
bodyshopid
|
||||||
});
|
});
|
||||||
|
|
||||||
const BearerToken = req.BearerToken;
|
const BearerToken = req.BearerToken;
|
||||||
|
|||||||
Reference in New Issue
Block a user