mirror of https://github.com/ghostfolio/ghostfolio
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
775 B
26 lines
775 B
import { Export } from '@ghostfolio/common/interfaces';
|
|
import type { RequestWithUser } from '@ghostfolio/common/types';
|
|
import { Controller, Get, Inject, Query, UseGuards } from '@nestjs/common';
|
|
import { REQUEST } from '@nestjs/core';
|
|
import { AuthGuard } from '@nestjs/passport';
|
|
|
|
import { ExportService } from './export.service';
|
|
|
|
@Controller('export')
|
|
export class ExportController {
|
|
public constructor(
|
|
private readonly exportService: ExportService,
|
|
@Inject(REQUEST) private readonly request: RequestWithUser
|
|
) {}
|
|
|
|
@Get()
|
|
@UseGuards(AuthGuard('jwt'))
|
|
public async export(
|
|
@Query('activityIds') activityIds?: string[]
|
|
): Promise<Export> {
|
|
return this.exportService.export({
|
|
activityIds,
|
|
userId: this.request.user.id
|
|
});
|
|
}
|
|
}
|
|
|