mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 17:00:55 +00:00
chore: code cleanup
This commit is contained in:
parent
9f8acd2374
commit
a43f1233d3
@ -50,18 +50,17 @@ const fromDBObject = (row) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const webhookEventValidator = async (allowedEvents, events) =>
|
const webhookEventValidator = async (allowedEvents, events) => {
|
||||||
mapAsync(
|
const allowedValues = Array.from(allowedEvents.values());
|
||||||
events,
|
|
||||||
(event) => {
|
await mapAsync(events, (event) => {
|
||||||
if (Array.from(allowedEvents.values()).includes(event)) {
|
if (allowedValues.includes(event)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new ValidationError(`Webhook event ${event} is not supported`);
|
throw new ValidationError(`Webhook event ${event} is not supported`);
|
||||||
},
|
});
|
||||||
{}
|
};
|
||||||
);
|
|
||||||
|
|
||||||
const createWebhookStore = ({ db }) => {
|
const createWebhookStore = ({ db }) => {
|
||||||
const webhookQueries = db.query('webhook');
|
const webhookQueries = db.query('webhook');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user