Thomas Kaul
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
16 additions and
16 deletions
-
apps/api/src/app/platform/platform.controller.ts
-
apps/api/src/app/platform/platform.service.ts
-
apps/client/src/app/components/admin-platform/admin-platform.component.ts
-
apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-account-platform.component.ts
|
|
@ -47,6 +47,7 @@ export class PlatformController { |
|
|
|
StatusCodes.FORBIDDEN |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
return this.platformService.createPlatform(data); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -6,6 +6,18 @@ import { Platform, Prisma } from '@prisma/client'; |
|
|
|
export class PlatformService { |
|
|
|
public constructor(private readonly prismaService: PrismaService) {} |
|
|
|
|
|
|
|
public async createPlatform(data: Prisma.PlatformCreateInput) { |
|
|
|
return this.prismaService.platform.create({ |
|
|
|
data |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public async deletePlatform( |
|
|
|
where: Prisma.PlatformWhereUniqueInput |
|
|
|
): Promise<Platform> { |
|
|
|
return this.prismaService.platform.delete({ where }); |
|
|
|
} |
|
|
|
|
|
|
|
public async getPlatform( |
|
|
|
platformWhereUniqueInput: Prisma.PlatformWhereUniqueInput |
|
|
|
): Promise<Platform> { |
|
|
@ -56,12 +68,6 @@ export class PlatformService { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public async createPlatform(data: Prisma.PlatformCreateInput) { |
|
|
|
return this.prismaService.platform.create({ |
|
|
|
data |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public async updatePlatform({ |
|
|
|
data, |
|
|
|
where |
|
|
@ -74,10 +80,4 @@ export class PlatformService { |
|
|
|
where |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public async deletePlatform( |
|
|
|
where: Prisma.PlatformWhereUniqueInput |
|
|
|
): Promise<Platform> { |
|
|
|
return this.prismaService.platform.delete({ where }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
@ -114,6 +114,7 @@ export class AdminPlatformComponent implements OnInit, OnDestroy { |
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
.subscribe((platforms) => { |
|
|
|
this.platforms = platforms; |
|
|
|
|
|
|
|
this.dataSource = new MatTableDataSource(platforms); |
|
|
|
this.dataSource.sort = this.sort; |
|
|
|
this.dataSource.sortingDataAccessor = get; |
|
|
@ -130,7 +131,6 @@ export class AdminPlatformComponent implements OnInit, OnDestroy { |
|
|
|
url: null |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
height: this.deviceType === 'mobile' ? '97.5vh' : '80vh', |
|
|
|
width: this.deviceType === 'mobile' ? '100vw' : '50rem' |
|
|
|
}); |
|
|
@ -170,7 +170,6 @@ export class AdminPlatformComponent implements OnInit, OnDestroy { |
|
|
|
url |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
height: this.deviceType === 'mobile' ? '97.5vh' : '80vh', |
|
|
|
width: this.deviceType === 'mobile' ? '100vw' : '50rem' |
|
|
|
}); |
|
|
|
|
|
@ -15,8 +15,8 @@ export class CreateOrUpdatePlatformDialog { |
|
|
|
private unsubscribeSubject = new Subject<void>(); |
|
|
|
|
|
|
|
public constructor( |
|
|
|
public dialogRef: MatDialogRef<CreateOrUpdatePlatformDialog>, |
|
|
|
@Inject(MAT_DIALOG_DATA) public data: CreateOrUpdatePlatformDialogParams |
|
|
|
@Inject(MAT_DIALOG_DATA) public data: CreateOrUpdatePlatformDialogParams, |
|
|
|
public dialogRef: MatDialogRef<CreateOrUpdatePlatformDialog> |
|
|
|
) {} |
|
|
|
|
|
|
|
public onCancel() { |
|
|
|