Skip to content

Commit 41532b3

Browse files
committed
Return related partner on organization assignment and removal
1 parent 0b6c28f commit 41532b3

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

src/components/user/dto/assign-organization-to-user.dto.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { Field, InputType, ObjectType } from '@nestjs/graphql';
22
import { Type } from 'class-transformer';
33
import { ValidateNested } from 'class-validator';
4-
import { type ID, IdField, MutationPlaceholderOutput } from '~/common';
4+
import { type ID, IdField } from '~/common';
5+
import { Partner } from '../../../components/partner/dto';
56

67
@InputType()
78
export class AssignOrganizationToUser {
@@ -20,8 +21,11 @@ export abstract class AssignOrganizationToUserInput {
2021
@Field()
2122
@Type(() => AssignOrganizationToUser)
2223
@ValidateNested()
23-
readonly request: AssignOrganizationToUser;
24+
readonly assignment: AssignOrganizationToUser;
2425
}
2526

2627
@ObjectType()
27-
export abstract class AssignOrganizationToUserOutput extends MutationPlaceholderOutput {}
28+
export abstract class AssignOrganizationToUserOutput {
29+
@Field()
30+
readonly partner: Partner;
31+
}

src/components/user/dto/remove-organization-from-user.dto.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { Field, InputType, ObjectType } from '@nestjs/graphql';
22
import { Type } from 'class-transformer';
33
import { ValidateNested } from 'class-validator';
4-
import { type ID, IdField, MutationPlaceholderOutput } from '~/common';
4+
import { type ID, IdField } from '~/common';
5+
import { Partner } from '../../../components/partner/dto';
56

67
@InputType()
78
export class RemoveOrganizationFromUser {
@@ -17,8 +18,11 @@ export abstract class RemoveOrganizationFromUserInput {
1718
@Field()
1819
@Type(() => RemoveOrganizationFromUser)
1920
@ValidateNested()
20-
readonly request: RemoveOrganizationFromUser;
21+
readonly assignment: RemoveOrganizationFromUser;
2122
}
2223

2324
@ObjectType()
24-
export abstract class RemoveOrganizationFromUserOutput extends MutationPlaceholderOutput {}
25+
export abstract class RemoveOrganizationFromUserOutput {
26+
@Field()
27+
readonly partner: Partner;
28+
}

src/components/user/user.gel.repository.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,8 @@ export class UserGelRepository
8484
hydrateAsNeo4j(): never {
8585
throw new NotImplementedException();
8686
}
87+
88+
getPrimaryOrganizationId(userId: ID): Promise<ID | null> {
89+
throw new NotImplementedException().with({ userId });
90+
}
8791
}

0 commit comments

Comments
 (0)