Added more options to "order", in the Recommendations API (#18487)

closes https://github.com/TryGhost/Product/issues/4000
This commit is contained in:
Sag 2023-10-04 16:32:03 -03:00 committed by GitHub
parent 27cec8b909
commit 2391ccc3db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -17,9 +17,14 @@ const RecommendationIncludesMap = {
};
const RecommendationOrderMap = {
title: 'title' as const,
reason: 'reason' as const,
excerpt: 'excerpt' as const,
one_click_subscribe: 'oneClickSubscribe' as const,
created_at: 'createdAt' as const,
updated_at: 'updatedAt' as const,
'count.clicks': 'clickCount' as const,
'count.subscribers': 'subscriberCount' as const,
created_at: 'createdAt' as const
'count.subscribers': 'subscriberCount' as const
};
export class RecommendationController {

View File

@ -489,7 +489,7 @@ describe('RecommendationController', function () {
user: {}
}),
{
message: 'order.0.field must be one of count.clicks, count.subscribers, created_at'
message: 'order.0.field must be one of title, reason, excerpt, one_click_subscribe, created_at, updated_at, count.clicks, count.subscribers'
}
);
});