mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-04-11 10:27:01 +02:00
chore: add eslint
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { PickType } from "@nestjs/swagger";
|
||||
import { UserDTO } from "src/user/dto/user.dto";
|
||||
|
||||
export class AuthRegisterDTO extends UserDTO {}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IsNotEmpty, IsString } from "class-validator";
|
||||
import { IsNotEmpty } from "class-validator";
|
||||
|
||||
export class RefreshAccessTokenDTO {
|
||||
@IsNotEmpty()
|
||||
|
||||
@@ -14,7 +14,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
|
||||
});
|
||||
}
|
||||
|
||||
async validate(payload: any) {
|
||||
async validate(payload: { sub: string }) {
|
||||
const user: User = await this.prisma.user.findUnique({
|
||||
where: { id: payload.sub },
|
||||
});
|
||||
|
||||
@@ -11,9 +11,6 @@ export class FileDTO {
|
||||
@Expose()
|
||||
size: string;
|
||||
|
||||
@Expose()
|
||||
url: boolean;
|
||||
|
||||
share: ShareDTO;
|
||||
|
||||
from(partial: Partial<FileDTO>) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Module } from "@nestjs/common";
|
||||
import { JwtModule } from "@nestjs/jwt";
|
||||
import { ShareModule } from "src/share/share.module";
|
||||
import { ShareService } from "src/share/share.service";
|
||||
import { FileController } from "./file.controller";
|
||||
import { FileService } from "./file.service";
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { IsNotEmpty } from "class-validator";
|
||||
|
||||
export class SharePasswordDto {
|
||||
password: string;
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ export class ShareService {
|
||||
}
|
||||
|
||||
async get(id: string) {
|
||||
let share: any = await this.prisma.share.findUnique({
|
||||
const share : any = await this.prisma.share.findUnique({
|
||||
where: { id },
|
||||
include: {
|
||||
files: true,
|
||||
@@ -115,11 +115,6 @@ export class ShareService {
|
||||
if (!share || !share.uploadLocked)
|
||||
throw new NotFoundException("Share not found");
|
||||
|
||||
share.files = share.files.map((file) => {
|
||||
file["url"] = `http://localhost:8080/file/${file.id}`;
|
||||
return file;
|
||||
});
|
||||
|
||||
return share;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user