mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-08 02:52:39 -05:00
Updated to always invalidate cache on tier edit (#14267)
refs https://github.com/TryGhost/Team/issues/1240 We were selectively invalidating cache on tier/product edit which was consistent with pattern for other APIs, but in case of tier/product, the model changed method always returns false due to how its setup. This change updates the edit to always invalidate cache, similar to tier add, to ensure sites don't see old tier values.
This commit is contained in:
parent
b03862d08a
commit
3fa836690e
2 changed files with 6 additions and 12 deletions
|
@ -93,7 +93,9 @@ module.exports = {
|
|||
options: [
|
||||
'id'
|
||||
],
|
||||
headers: {},
|
||||
headers: {
|
||||
cacheInvalidate: true
|
||||
},
|
||||
validation: {
|
||||
options: {
|
||||
id: {
|
||||
|
@ -108,11 +110,6 @@ module.exports = {
|
|||
frame.options
|
||||
);
|
||||
|
||||
if (model.wasChanged()) {
|
||||
this.headers.cacheInvalidate = true;
|
||||
} else {
|
||||
this.headers.cacheInvalidate = false;
|
||||
}
|
||||
return model;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,9 @@ module.exports = {
|
|||
options: [
|
||||
'id'
|
||||
],
|
||||
headers: {},
|
||||
headers: {
|
||||
cacheInvalidate: true
|
||||
},
|
||||
validation: {
|
||||
options: {
|
||||
id: {
|
||||
|
@ -112,11 +114,6 @@ module.exports = {
|
|||
frame.options
|
||||
);
|
||||
|
||||
if (model.wasChanged()) {
|
||||
this.headers.cacheInvalidate = true;
|
||||
} else {
|
||||
this.headers.cacheInvalidate = false;
|
||||
}
|
||||
return model;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue