mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 09:07:09 +00:00
Invalidate planner endpoint cache when setting remarks
This commit is contained in:
@@ -43,15 +43,26 @@ const rels = [
|
|||||||
matches: [ ],
|
matches: [ ],
|
||||||
callback (url, data) {
|
callback (url, data) {
|
||||||
if (data.payload?.table == "info") {
|
if (data.payload?.table == "info") {
|
||||||
|
const pid = data.payload?.pid;
|
||||||
|
const key = (data.payload?.new ?? data.payload?.old)?.key;
|
||||||
|
|
||||||
const rx = /^\/project\/([^\/]+)\/info\/([^\/?]+)[\/?]?/;
|
const rx = /^\/project\/([^\/]+)\/info\/([^\/?]+)[\/?]?/;
|
||||||
const match = url.match(rx);
|
const match = url.match(rx);
|
||||||
if (match) {
|
if (match) {
|
||||||
if (match[1] == data.payload.pid) {
|
if (match[1] == pid) {
|
||||||
if (match[2] == data.payload?.old?.key || match[2] == data.payload?.new?.key) {
|
if (match[2] == data.payload?.old?.key || match[2] == data.payload?.new?.key) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (key == "plan") {
|
||||||
|
const rx = /^\/project\/([^\/]+)\/plan[\/?]?/;
|
||||||
|
const match = url.match(rx);
|
||||||
|
if (match) {
|
||||||
|
return match[1] == pid;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user