File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
backend/apps/cloud/src/revenue Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -385,12 +385,22 @@ export class RevenueAnalyticsController {
385385 ) : Promise < RevenueBreakdownDto > {
386386 this . logger . log ( { userId, ...dto } , 'GET /log/revenue/breakdown' )
387387
388- const project = await this . projectService . getFullProject ( dto . pid )
388+ const project = await this . projectService . getFullProject (
389+ dto . pid ,
390+ undefined ,
391+ [ 'stripeApiKeyEnc' , 'paddleApiKeyEnc' ] ,
392+ )
389393
390394 if ( _isEmpty ( project ) ) {
391395 throw new NotFoundException ( 'Project not found' )
392396 }
393397
398+ if ( ! project . paddleApiKeyEnc && ! project . stripeApiKeyEnc ) {
399+ throw new BadRequestException (
400+ 'Revenue tracking is not configured for this project' ,
401+ )
402+ }
403+
394404 this . projectService . allowedToView ( project , userId )
395405
396406 const safeTimezone = this . analyticsService . getSafeTimezone ( dto . timezone )
You can’t perform that action at this time.
0 commit comments