Browse Source

Clean up (#2390)

pull/2391/head
Thomas Kaul 1 year ago
committed by GitHub
parent
commit
01b6bb5b99
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      apps/api/src/app/platform/platform.controller.ts
  2. 24
      apps/api/src/app/platform/platform.service.ts
  3. 3
      apps/client/src/app/components/admin-platform/admin-platform.component.ts
  4. 4
      apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-account-platform.component.ts

1
apps/api/src/app/platform/platform.controller.ts

@ -47,6 +47,7 @@ export class PlatformController {
StatusCodes.FORBIDDEN
);
}
return this.platformService.createPlatform(data);
}

24
apps/api/src/app/platform/platform.service.ts

@ -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 });
}
}

3
apps/client/src/app/components/admin-platform/admin-platform.component.ts

@ -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'
});

4
apps/client/src/app/components/admin-platform/create-or-update-platform-dialog/create-or-update-account-platform.component.ts

@ -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() {

Loading…
Cancel
Save