Ensure that project is defined.

Which would not be in the case of the `project` event unless we
look at the `new` and `old` properties.
This commit is contained in:
D. Berge
2023-11-04 10:41:37 +01:00
parent 12307b7ae6
commit 60932300c1

View File

@@ -66,7 +66,7 @@ const rels = [
function invalidateCache (data, cache) {
return new Promise((resolve, reject) => {
const channel = data.channel;
const project = data.payload.pid;
const project = data.payload.pid ?? data.payload?.new?.pid ?? data.payload?.old?.pid;
const operation = data.payload.operation;
const table = data.payload.table;
const fields = { channel, project, operation, table };