0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Added subscribe_on_signup to newsletter content API data (#14808)

- portal needs this to show default newsletter subscription during signup
This commit is contained in:
Rishabh Garg 2022-05-12 21:31:50 +05:30 committed by GitHub
parent 1e456f7e87
commit afd92813c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View file

@ -10,6 +10,7 @@ module.exports = (model, frame) => {
name: jsonModel.name,
description: jsonModel.description,
slug: jsonModel.slug,
subscribe_on_signup: jsonModel.subscribe_on_signup,
visibility: jsonModel.visibility,
sort_order: jsonModel.sort_order,
created_at: jsonModel.created_at,

View file

@ -20,6 +20,7 @@ Object {
"name": "Default Newsletter",
"slug": "default-newsletter",
"sort_order": 0,
"subscribe_on_signup": true,
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/,
"visibility": "members",
@ -31,6 +32,7 @@ Object {
"name": "Daily newsletter",
"slug": "daily-newsletter",
"sort_order": 1,
"subscribe_on_signup": false,
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/,
"visibility": "members",
@ -42,6 +44,7 @@ Object {
"name": "Weekly newsletter",
"slug": "weekly-newsletter",
"sort_order": 2,
"subscribe_on_signup": true,
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/,
"visibility": "members",
@ -54,7 +57,7 @@ exports[`Newsletters Content API Can request only active newsletters 2: [headers
Object {
"access-control-allow-origin": "*",
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
"content-length": "918",
"content-length": "1000",
"content-type": "application/json; charset=utf-8",
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
"vary": "Accept-Encoding",
@ -82,6 +85,7 @@ Object {
"name": "Default Newsletter",
"slug": "default-newsletter",
"sort_order": 0,
"subscribe_on_signup": true,
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/,
"visibility": "members",
@ -93,6 +97,7 @@ Object {
"name": "Daily newsletter",
"slug": "daily-newsletter",
"sort_order": 1,
"subscribe_on_signup": false,
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/,
"visibility": "members",
@ -104,6 +109,7 @@ Object {
"name": "Weekly newsletter",
"slug": "weekly-newsletter",
"sort_order": 2,
"subscribe_on_signup": true,
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
"uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/,
"visibility": "members",
@ -116,7 +122,7 @@ exports[`Newsletters Content API Cannot override filters to fetch archived newsl
Object {
"access-control-allow-origin": "*",
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
"content-length": "918",
"content-length": "1000",
"content-type": "application/json; charset=utf-8",
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
"vary": "Accept-Encoding",

View file

@ -239,6 +239,7 @@ describe('Unit: utils/serializers/output/mappers', function () {
name: newsletter.name,
description: newsletter.description,
slug: newsletter.slug,
subscribe_on_signup: newsletter.subscribe_on_signup,
visibility: newsletter.visibility,
sort_order: newsletter.sort_order,
created_at: newsletter.created_at,