Skip to content

Commit 6404b6e

Browse files
committed
feat: add getByUsername method to DUser service for user retrieval by username
1 parent f6934a3 commit 6404b6e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/components/d-user/DUser.service.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import {ReactiveArrayService, ReactiveArrayStore} from "../../utils/reactiveArrayService";
1+
import {ReactiveArrayService} from "../../utils/reactiveArrayService";
22
import {
3-
Maybe,
43
User,
54
UsersEmailVerificationInput,
65
UsersEmailVerificationPayload,
7-
UserSession,
86
UsersIdentityLinkInput,
97
UsersIdentityLinkPayload,
108
UsersIdentityLoginInput,
@@ -24,11 +22,11 @@ import {
2422
UsersMfaTotpValidateSecretInput,
2523
UsersMfaTotpValidateSecretPayload,
2624
UsersPasswordResetInput,
27-
UsersPasswordResetPayload, UsersPasswordResetRequestInput,
25+
UsersPasswordResetPayload,
26+
UsersPasswordResetRequestInput,
2827
UsersPasswordResetRequestPayload,
2928
UsersRegisterInput,
30-
UsersRegisterPayload,
31-
UsersUpdateInput
29+
UsersRegisterPayload
3230
} from "@code0-tech/sagittarius-graphql-types";
3331
import {DUserView} from "./DUser.view";
3432

@@ -41,6 +39,10 @@ export abstract class DUserReactiveService extends ReactiveArrayService<DUserVie
4139
return this.values().find(user => user.id === id);
4240
}
4341

42+
getByUsername(username: User['username']): DUserView | undefined {
43+
return this.values().find(user => user.username === username);
44+
}
45+
4446
abstract usersEmailVerification(payload: UsersEmailVerificationInput): Promise<UsersEmailVerificationPayload | undefined>;
4547

4648
abstract usersIdentityLink(payload: UsersIdentityLinkInput): Promise<UsersIdentityLinkPayload | undefined>;

0 commit comments

Comments
 (0)