Skip to content

Commit

Permalink
wip: some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
c27gc committed Jul 10, 2023
1 parent 4b6c2ad commit b83a8ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class PrivateSharingController {
let errorMessage = error.message;

if (error instanceof InvalidOwnerError) {
res.status(HttpStatus.BAD_REQUEST);
res.status(HttpStatus.FORBIDDEN);
} else {
new Logger().error(
`[PRIVATESHARING/GRANTACCESS] ERROR: ${
Expand Down
8 changes: 5 additions & 3 deletions src/modules/private-share-folder/private-sharing.usecase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { User } from '../user/user.domain';
import { SequelizePrivateSharingRepository } from './private-sharing.repository';
import { SequelizeUserRepository } from '../user/user.repository';
import { SequelizeFolderRepository } from '../folder/folder.repository';
import { PrivateSharingFolder } from './private-sharing-folder.domain';
import { PrivateSharingRole } from './private-sharing-role.domain';

export class InvalidOwnerError extends Error {
constructor() {
Expand All @@ -19,9 +21,9 @@ export class PrivateSharingUseCase {
) {}
async grantPrivileges(
owner: User,
userUuid: string,
privateFolderId: string,
roleUuid: string,
userUuid: User['uuid'],
privateFolderId: PrivateSharingFolder['id'],
roleUuid: PrivateSharingRole['id'],
) {
const privateFolder = await this.privateSharingRespository.findById(
privateFolderId,
Expand Down

0 comments on commit b83a8ed

Please sign in to comment.