Request fresh responses when refreshing data from the server

This commit is contained in:
D. Berge
2025-08-07 10:40:23 +02:00
parent fe421f545c
commit d769ec48dd
7 changed files with 7 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ async function refreshEvents ({commit, dispatch, state, rootState}, [modifiedAft
? `/project/${pid}/event/changes/${(new Date(modifiedAfter)).toISOString()}?unique=t` ? `/project/${pid}/event/changes/${(new Date(modifiedAfter)).toISOString()}?unique=t`
: `/project/${pid}/event`; : `/project/${pid}/event`;
const init = { const init = {
cache: "reload",
signal: state.loading.signal signal: state.loading.signal
}; };
const res = await dispatch('api', [url, init]); const res = await dispatch('api', [url, init]);

View File

@@ -11,6 +11,7 @@ async function refreshLabels ({commit, dispatch, state, rootState}) {
const pid = rootState.project.projectId; const pid = rootState.project.projectId;
const url = `/project/${pid}/label`; const url = `/project/${pid}/label`;
const init = { const init = {
cache: "reload",
signal: state.loading.signal signal: state.loading.signal
}; };
const res = await dispatch('api', [url, init]); const res = await dispatch('api', [url, init]);

View File

@@ -11,6 +11,7 @@ async function refreshLines ({commit, dispatch, state, rootState}) {
const pid = rootState.project.projectId; const pid = rootState.project.projectId;
const url = `/project/${pid}/line`; const url = `/project/${pid}/line`;
const init = { const init = {
cache: "reload",
signal: state.loading.signal signal: state.loading.signal
}; };
const res = await dispatch('api', [url, init]); const res = await dispatch('api', [url, init]);

View File

@@ -11,6 +11,7 @@ async function refreshPlan ({commit, dispatch, state, rootState}) {
const pid = rootState.project.projectId; const pid = rootState.project.projectId;
const url = `/project/${pid}/plan`; const url = `/project/${pid}/plan`;
const init = { const init = {
cache: "reload",
signal: state.loading.signal signal: state.loading.signal
}; };
const res = await dispatch('api', [url, init]); const res = await dispatch('api', [url, init]);

View File

@@ -2,6 +2,7 @@
async function getProject ({commit, dispatch}, projectId) { async function getProject ({commit, dispatch}, projectId) {
const init = { const init = {
headers: { headers: {
cache: "reload",
"If-None-Match": "" // Ensure we get a fresh response "If-None-Match": "" // Ensure we get a fresh response
} }
}; };

View File

@@ -11,6 +11,7 @@ async function refreshProjects ({commit, dispatch, state, rootState}) {
const pid = rootState.project.projectId; const pid = rootState.project.projectId;
const url = `/project`; const url = `/project`;
const init = { const init = {
cache: "reload",
signal: state.loading.signal signal: state.loading.signal
}; };
const res = await dispatch('api', [url, init, null, {silent:true}]); const res = await dispatch('api', [url, init, null, {silent:true}]);

View File

@@ -11,6 +11,7 @@ async function refreshSequences ({commit, dispatch, state, rootState}) {
const pid = rootState.project.projectId; const pid = rootState.project.projectId;
const url = `/project/${pid}/sequence?files=true`; const url = `/project/${pid}/sequence?files=true`;
const init = { const init = {
cache: "reload",
signal: state.loading.signal signal: state.loading.signal
}; };
const res = await dispatch('api', [url, init]); const res = await dispatch('api', [url, init]);