0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

🐛 Fixed page revision returning empty array on update and restore (#17042)

closes https://github.com/TryGhost/Team/issues/3491

- the `PostRevisionModel` had a `belongsTo` relation to Post which resulted in the Page model returning an empty array in the `post_revisions` property.
- Simply removing it fixed it. refs https://ghost.slack.com/archives/C02G9E68C/p1686912389383579?thread_ts=1686909240.034419&cid=C02G9E68C
This commit is contained in:
Ronald Langeveld 2023-06-16 13:24:02 +02:00 committed by GitHub
parent 99aeb73ecc
commit 77e3b3e947
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -3,7 +3,15 @@ import ApplicationAdapter from 'ghost-admin/adapters/application';
export default class Page extends ApplicationAdapter {
// posts and pages now include everything by default
buildIncludeURL(store, modelName, id, snapshot, requestType, query) {
return this.buildURL(modelName, id, snapshot, requestType, query);
const url = this.buildURL(modelName, id, snapshot, requestType, query);
const parsedUrl = new URL(url);
if (snapshot?.adapterOptions?.saveRevision) {
const saveRevision = snapshot.adapterOptions.saveRevision;
parsedUrl.searchParams.append('save_revision', saveRevision);
}
return parsedUrl.toString();
}
buildURL() {

View file

@ -1,7 +1,6 @@
import Model, {attr, belongsTo} from '@ember-data/model';
export default class PostRevisionModel extends Model {
@belongsTo('post') post;
@attr('string') lexical;
@attr('string') title;
@attr('string') featureImage;