add: get dpage plan by id
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-06-17 16:40:04 +03:30
parent bd1d8685a7
commit b73f5cf7a7
3 changed files with 17 additions and 1 deletions
+8 -1
View File
@@ -1,4 +1,4 @@
import { Controller, Get, Post, Body, Query } from '@nestjs/common';
import { Controller, Get, Post, Body, Query, Param } from '@nestjs/common';
import { DPageService } from './dpage.service';
import { LoginDto } from './dto/login.dto';
import { UserDec } from '../../common/decorators/user.decorator';
@@ -42,6 +42,13 @@ export class DpageController {
getDpagePlans() {
return this.dpageService.getDpagePlans();
}
@SkipAuth()
@ApiKeyGuards()
@Get('dpage-admin/plans/:id')
getDpagePlanById(@Param('id') id: string) {
return this.dpageService.getDpagePlanById(id);
}
// @Get(':id')
// findOne(@Param('id') id: string) {
// return this.dpageService.findOne(+id);
+4
View File
@@ -261,6 +261,10 @@ export class DPageService {
return this.subscriptionService.getDpagePlans();
}
async getDpagePlanById(id: string) {
return this.subscriptionService.getDpagePlanById(id);
}
}
@@ -693,6 +693,11 @@ export class SubscriptionsService {
const plans = await this.subscriptionsPlanRepository.find({ where: { service:{slug:'Dpage'} } });
return plans;
}
async getDpagePlanById(id: string) {
const plan = await this.subscriptionsPlanRepository.findOne({ where: { id, service:{slug:'Dpage'} } });
return plan;
}
//************************************ */
async softDeleteUSerSubscription(userSubscriptionId: string) {