Skip to content

Conversation

@Angeluz-07
Copy link
Contributor

Close #129

custom_params = self.generate_params(date_range)

return CosmosDBRepository.find_all(
time_entries = CosmosDBRepository.find_all(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this returning the time-entries belonging to the JWT user or all of them?
Can you please restrict to only the time-entries belonging to the user in the JWT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this returning the time-entries belonging to the JWT user or all of them?

Yes. That is how it works.

Check out the user_id/owner_id value is passed in the dictionary conditions, in the dao:

class TimeEntriesCosmosDBDao(APICosmosDBDao, TimeEntriesDao):
...
   def get_all(self, conditions: dict = {}) -> list:
        event_ctx = self.create_event_context("read-many")
        conditions.update({"owner_id": event_ctx.user_id})

        date_range = self.handle_date_filter_args(args=conditions)
        return self.repository.find_all(
            event_ctx, conditions=conditions, date_range=date_range
        )

@Angeluz-07 Angeluz-07 merged commit b6ee255 into master May 13, 2020
@Angeluz-07 Angeluz-07 deleted the feature/include-project-name-in-time-entry-response#129 branch May 15, 2020 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include project name on time-entries response

4 participants