Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
c27gc committed Jul 20, 2023
1 parent e5dfd55 commit 8439ba4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsUUID } from 'class-validator';
import { PrivateSharingRole } from '../private-sharing-role.domain';

export class UpdatePrivilegesDto {
@IsUUID()
@ApiProperty({ required: true })
roleId: string;
roleId: PrivateSharingRole['id'];
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { Pagination } from 'src/lib/pagination';
import { Response } from 'express';
import { GrantPrivilegesDto } from './dto/grant-privileges.dto';
import { UpdatePrivilegesDto } from './dto/update-privilages.dto';
import { PrivateSharingFolderRole } from './private-sharing-folder-roles.domain';

@ApiTags('Private Sharing')
@Controller('private-sharing')
Expand Down Expand Up @@ -83,7 +84,8 @@ export class PrivateSharingController {
@ApiOkResponse({ description: 'Update role of a user on a folder' })
@ApiBearerAuth()
async updateRole(
@Param('privateFolderRoleId') privateFolderRoleId: string,
@Param('privateFolderRoleId')
privateFolderRoleId: PrivateSharingFolderRole['id'],
@UserDecorator() user: User,
@Body() dto: UpdatePrivilegesDto,
@Res({ passthrough: true }) res: Response,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class SequelizePrivateSharingRepository

async updatePrivateFolderRole(
privateFolderRole: PrivateSharingFolderRole,
roleId: string,
roleId: PrivateSharingRole['id'],
): Promise<void> {
await this.privateSharingFolderRole.update(
{
Expand All @@ -89,7 +89,7 @@ export class SequelizePrivateSharingRepository
}

async findPrivateFolderRoleById(
privateFolderRoleId: string,
privateFolderRoleId: PrivateSharingFolderRole['id'],
): Promise<PrivateSharingFolderRole> {
const privateFolderRole = await this.privateSharingFolderRole.findByPk(
privateFolderRoleId,
Expand Down

0 comments on commit 8439ba4

Please sign in to comment.