Added verified property to Mentions Admin API

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

Rather than blindly passing all data through the API we explicitly include each
new property. This allows us to make changes to the core entities without
affecting the API. The verified property is being added now to give design the
ability to display these mentions differently.

We also needed to include the verified property in the return value of toJSON,
this was missed as part of the original entity changes
This commit is contained in:
Fabien "egg" O'Carroll 2023-02-16 14:23:59 +07:00
parent dd48f65712
commit c6b90b6ac7
3 changed files with 6 additions and 2 deletions

View File

@ -13,6 +13,7 @@ module.exports = (model) => {
source_excerpt: json.sourceExcerpt,
source_author: json.sourceAuthor,
source_favicon: json.sourceFavicon,
source_featured_image: json.sourceFeaturedImage
source_featured_image: json.sourceFeaturedImage,
verified: json.verified
};
};

View File

@ -16,6 +16,7 @@ Object {
"source_title": Any<String>,
"target": Any<String>,
"timestamp": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"verified": false,
},
Object {
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
@ -30,6 +31,7 @@ Object {
"source_title": Any<String>,
"target": Any<String>,
"timestamp": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"verified": false,
},
],
"meta": Object {

View File

@ -153,7 +153,8 @@ module.exports = class Mention {
sourceAuthor: this.sourceAuthor,
sourceExcerpt: this.sourceExcerpt,
sourceFavicon: this.sourceFavicon,
sourceFeaturedImage: this.sourceFeaturedImage
sourceFeaturedImage: this.sourceFeaturedImage,
verified: this.verified
};
}