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

Fixed empty response when import triggers a job

refs d60d348c88

- When the import triggers a background job the meta response should contain no data otherwise the client can mistake it for completed import
This commit is contained in:
Naz 2021-07-23 21:14:06 +04:00
parent d60d348c88
commit ac3602cced
3 changed files with 7 additions and 3 deletions

View file

@ -74,8 +74,10 @@ const membersImporter = new MembersCSVImporter({
const processImport = async (options) => {
const result = await membersImporter.process(options);
const freezeTriggered = result.meta.freeze;
delete result.meta.freeze;
if (result.meta.freeze) {
if (freezeTriggered) {
limits.init({
emails: {
disabled: true,

View file

@ -501,7 +501,8 @@ describe('Members API (canary)', function () {
const jsonResponse = res.body;
should.exist(jsonResponse);
should.not.exist(jsonResponse.meta);
should.exist(jsonResponse.meta);
should.not.exist(jsonResponse.meta.stats);
});
});

View file

@ -460,7 +460,8 @@ describe('Members API', function () {
const jsonResponse = res.body;
should.exist(jsonResponse);
should.not.exist(jsonResponse.meta);
should.exist(jsonResponse.meta);
should.not.exist(jsonResponse.meta.stats);
});
});