Beispiel #1
0
    async def create(self):

        create_user = resolve(CreateUserUseCase)

        user = await create_user(**self.user_data.dict())

        return user
Beispiel #2
0
    def retrieve(self, **kwargs):

        retrieve_users = resolve(RetrieveUsersUseCase)

        return retrieve_users(limit=self.limit,
                              offset=self.offset,
                              is_active=self.is_active)
    def update(self, *args, **kwargs):

        activate_user = resolve(ActivateUserUseCase)

        user = activate_user(**self.activation_data.dict())

        return prepare_object_to_response(user)
Beispiel #4
0
    def create(self, **kwargs) -> Dict:

        create_user = resolve(CreateUserUseCase)

        create_user(**self.user_data.dict())

        return {}
    def create(self, **kwargs):

        refresh_tokens = resolve(RefreshTokenUseCase)

        return refresh_tokens(access_token=self.access_token,
                              **self.refresh_token.dict())
    def create(self, **kwargs):

        access_token = resolve(AuthenticateUserUseCase)

        return access_token(username=self.username, password=self.password)
Beispiel #7
0
    def retrieve(self, **kwargs):

        retrieve_user = resolve(RetrieveUsersUseCase)

        return retrieve_user(pk=self.pk)
Beispiel #8
0
 def update(self, *args, **kwargs):
     update_user = resolve(UpdateUserUseCase)
     return update_user(**self.user_payload.dict(exclude_unset=True),
                        pk=self.pk)