mirror of https://github.com/ghostfolio/ghostfolio
committed by
GitHub
54 changed files with 16635 additions and 21632 deletions
@ -0,0 +1,22 @@ |
|||
import { PlatformService } from '@ghostfolio/api/app/platform/platform.service'; |
|||
import { HasPermission } from '@ghostfolio/api/decorators/has-permission.decorator'; |
|||
import { HasPermissionGuard } from '@ghostfolio/api/guards/has-permission.guard'; |
|||
import { PlatformsResponse } from '@ghostfolio/common/interfaces'; |
|||
import { permissions } from '@ghostfolio/common/permissions'; |
|||
|
|||
import { Controller, Get, UseGuards } from '@nestjs/common'; |
|||
import { AuthGuard } from '@nestjs/passport'; |
|||
|
|||
@Controller('platforms') |
|||
export class PlatformsController { |
|||
public constructor(private readonly platformService: PlatformService) {} |
|||
|
|||
@Get() |
|||
@HasPermission(permissions.readPlatforms) |
|||
@UseGuards(AuthGuard('jwt'), HasPermissionGuard) |
|||
public async getPlatforms(): Promise<PlatformsResponse> { |
|||
const platforms = await this.platformService.getPlatforms(); |
|||
|
|||
return { platforms }; |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
import { PlatformModule } from '@ghostfolio/api/app/platform/platform.module'; |
|||
|
|||
import { Module } from '@nestjs/common'; |
|||
|
|||
import { PlatformsController } from './platforms.controller'; |
|||
|
|||
@Module({ |
|||
controllers: [PlatformsController], |
|||
imports: [PlatformModule] |
|||
}) |
|||
export class PlatformsModule {} |
|||
@ -1 +1,3 @@ |
|||
import 'jest-preset-angular/setup-jest'; |
|||
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone'; |
|||
|
|||
setupZoneTestEnv(); |
|||
|
|||
@ -1,3 +1,6 @@ |
|||
export interface CreateStripeCheckoutSessionResponse { |
|||
/** @deprecated */ |
|||
sessionId: string; |
|||
|
|||
sessionUrl: string; |
|||
} |
|||
|
|||
@ -0,0 +1,5 @@ |
|||
import { Platform } from '@prisma/client'; |
|||
|
|||
export interface PlatformsResponse { |
|||
platforms: Platform[]; |
|||
} |
|||
@ -1 +1,3 @@ |
|||
import 'jest-preset-angular/setup-jest'; |
|||
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone'; |
|||
|
|||
setupZoneTestEnv(); |
|||
|
|||
File diff suppressed because it is too large
Loading…
Reference in new issue